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 //===----------------------------------------------------------------------===// 8 9 // test <ctime> 10 // std::timespec and std::timespec_get 11 12 // UNSUPPORTED: c++03, c++11, c++14 13 14 // ::timespec_get is provided by the C library, but it's marked as 15 // unavailable until macOS 10.15 16 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}} 17 18 // MinGW lacks timespec_get. 19 // XFAIL: target={{.+}}-windows-gnu 20 21 #include <ctime> 22 #include <type_traits> 23 24 #ifndef TIME_UTC 25 #error TIME_UTC not defined 26 #endif 27 28 std::timespec tmspec = {}; 29 static_assert(std::is_same<decltype(std::timespec_get(&tmspec, 0)), int>::value, ""); 30