blob: 419f415dee19aed498f2e92ce35b09288205da47 [file] [log] [blame]
Howard Hinnantc52f43e2010-08-22 00:59:46 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantc52f43e2010-08-22 00:59:46 +00007//
8//===----------------------------------------------------------------------===//
9
10#include <ctime>
11#include <type_traits>
12
13#ifndef NULL
14#error NULL not defined
15#endif
16
17#ifndef CLOCKS_PER_SEC
18#error CLOCKS_PER_SEC not defined
19#endif
20
21int main()
22{
23 std::clock_t c = 0;
Dan Albert1d4a1ed2016-05-25 22:36:09 -070024 ((void)c); // avoid unused warning
Howard Hinnantc52f43e2010-08-22 00:59:46 +000025 std::size_t s = 0;
26 std::time_t t = 0;
27 std::tm tm = {0};
28 char str[3];
29 static_assert((std::is_same<decltype(std::clock()), std::clock_t>::value), "");
30 static_assert((std::is_same<decltype(std::difftime(t,t)), double>::value), "");
31 static_assert((std::is_same<decltype(std::mktime(&tm)), std::time_t>::value), "");
32 static_assert((std::is_same<decltype(std::time(&t)), std::time_t>::value), "");
33 static_assert((std::is_same<decltype(std::asctime(&tm)), char*>::value), "");
34 static_assert((std::is_same<decltype(std::ctime(&t)), char*>::value), "");
35 static_assert((std::is_same<decltype(std::gmtime(&t)), std::tm*>::value), "");
36 static_assert((std::is_same<decltype(std::localtime(&t)), std::tm*>::value), "");
37 static_assert((std::is_same<decltype(std::strftime(str,s,"",&tm)), std::size_t>::value), "");
38}