[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / depr / depr.c.headers / time_h.pass.cpp
blob31aff19c535f019f5a2b07712806c1209f971852
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // test <time.h>
11 #include <time.h>
12 #include <type_traits>
14 #include "test_macros.h"
16 #ifndef NULL
17 #error NULL not defined
18 #endif
20 #ifndef CLOCKS_PER_SEC
21 #error CLOCKS_PER_SEC not defined
22 #endif
24 int main(int, char**)
26 clock_t c = 0; ((void)c);
27 size_t s = 0;
28 time_t t = 0;
29 tm tmv = {};
30 static_assert((std::is_same<decltype(clock()), clock_t>::value), "");
31 static_assert((std::is_same<decltype(difftime(t,t)), double>::value), "");
32 static_assert((std::is_same<decltype(mktime(&tmv)), time_t>::value), "");
33 static_assert((std::is_same<decltype(time(&t)), time_t>::value), "");
34 static_assert((std::is_same<decltype(asctime(&tmv)), char*>::value), "");
35 static_assert((std::is_same<decltype(ctime(&t)), char*>::value), "");
36 static_assert((std::is_same<decltype(gmtime(&t)), tm*>::value), "");
37 static_assert((std::is_same<decltype(localtime(&t)), tm*>::value), "");
38 char* c1 = 0;
39 const char* c2 = 0;
40 static_assert((std::is_same<decltype(strftime(c1,s,c2,&tmv)), size_t>::value), "");
42 return 0;