Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / language.support / support.runtime / ctime.timespec.compile.pass.cpp
blob9a512f6ccfbd32edaa0851e0b891d1b8de8c73a6
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 <ctime>
10 // std::timespec and std::timespec_get
12 // UNSUPPORTED: c++03, c++11, c++14
14 // XFAIL: LIBCXX-AIX-FIXME
16 // ::timespec_get is provided by the C library, but it's marked as
17 // unavailable until macOS 10.15
18 // XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
20 // ::timespec_get is available starting with Android Q (API 29)
21 // XFAIL: target={{.+}}-android{{(eabi)?(21|22|23|24|25|26|27|28)}}
23 #include <ctime>
24 #include <type_traits>
26 #ifndef TIME_UTC
27 #error TIME_UTC not defined
28 #endif
30 std::timespec tmspec = {};
31 static_assert(std::is_same<decltype(std::timespec_get(&tmspec, 0)), int>::value, "");