1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This test uses new symbols that were not defined in the libc++ shipped on 11 // darwin11 and darwin12: 12 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin11 13 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin12 14 15 // Due to C++17 inline variables ASAN flags this test as containing an ODR 16 // violation because Clock::is_steady is defined in both the dylib and this TU. 17 // UNSUPPORTED: asan 18 19 // <chrono> 20 21 // high_resolution_clock 22 23 // check clock invariants 24 25 #include <chrono> 26 27 template <class _Tp> test(const _Tp &)28void test(const _Tp &) {} 29 main()30int main() 31 { 32 typedef std::chrono::high_resolution_clock C; 33 static_assert((std::is_same<C::rep, C::duration::rep>::value), ""); 34 static_assert((std::is_same<C::period, C::duration::period>::value), ""); 35 static_assert((std::is_same<C::duration, C::time_point::duration>::value), ""); 36 static_assert(C::is_steady || !C::is_steady, ""); 37 test(std::chrono::high_resolution_clock::is_steady); 38 } 39