diff options
Diffstat (limited to 'test/std/language.support/support.runtime/ctime.pass.cpp')
| -rw-r--r-- | test/std/language.support/support.runtime/ctime.pass.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/std/language.support/support.runtime/ctime.pass.cpp b/test/std/language.support/support.runtime/ctime.pass.cpp index 34343b247f21..908dc480884c 100644 --- a/test/std/language.support/support.runtime/ctime.pass.cpp +++ b/test/std/language.support/support.runtime/ctime.pass.cpp @@ -11,6 +11,7 @@ #include <ctime> #include <type_traits> +#include "test_macros.h" #ifndef NULL #error NULL not defined @@ -20,12 +21,22 @@ #error CLOCKS_PER_SEC not defined #endif +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#ifndef TIME_UTC +#error TIME_UTC not defined +#endif +#endif + int main() { std::clock_t c = 0; std::size_t s = 0; std::time_t t = 0; std::tm tm = {}; +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) + std::timespec tmspec = {}; + ((void)tmspec); // Prevent unused warning +#endif ((void)c); // Prevent unused warning ((void)s); // Prevent unused warning ((void)t); // Prevent unused warning @@ -34,6 +45,9 @@ int main() static_assert((std::is_same<decltype(std::difftime(t,t)), double>::value), ""); static_assert((std::is_same<decltype(std::mktime(&tm)), std::time_t>::value), ""); static_assert((std::is_same<decltype(std::time(&t)), std::time_t>::value), ""); +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) + static_assert((std::is_same<decltype(std::timespec_get(nullptr, 0)), int>::value), ""); +#endif #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS static_assert((std::is_same<decltype(std::asctime(&tm)), char*>::value), ""); static_assert((std::is_same<decltype(std::ctime(&t)), char*>::value), ""); |
