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 | // WARNING: This test was generated by generate_feature_test_macro_components.py |
10 | // and should not be edited manually. |
11 | |
12 | // UNSUPPORTED: no-threads |
13 | |
14 | // <mutex> |
15 | |
16 | // Test the feature test macros defined by <mutex> |
17 | |
18 | // clang-format off |
19 | |
20 | #include <mutex> |
21 | #include "test_macros.h" |
22 | |
23 | #if TEST_STD_VER < 14 |
24 | |
25 | # ifdef __cpp_lib_scoped_lock |
26 | # error "__cpp_lib_scoped_lock should not be defined before c++17" |
27 | # endif |
28 | |
29 | #elif TEST_STD_VER == 14 |
30 | |
31 | # ifdef __cpp_lib_scoped_lock |
32 | # error "__cpp_lib_scoped_lock should not be defined before c++17" |
33 | # endif |
34 | |
35 | #elif TEST_STD_VER == 17 |
36 | |
37 | # if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS |
38 | # ifndef __cpp_lib_scoped_lock |
39 | # error "__cpp_lib_scoped_lock should be defined in c++17" |
40 | # endif |
41 | # if __cpp_lib_scoped_lock != 201703L |
42 | # error "__cpp_lib_scoped_lock should have the value 201703L in c++17" |
43 | # endif |
44 | # else |
45 | # ifdef __cpp_lib_scoped_lock |
46 | # error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" |
47 | # endif |
48 | # endif |
49 | |
50 | #elif TEST_STD_VER == 20 |
51 | |
52 | # if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS |
53 | # ifndef __cpp_lib_scoped_lock |
54 | # error "__cpp_lib_scoped_lock should be defined in c++20" |
55 | # endif |
56 | # if __cpp_lib_scoped_lock != 201703L |
57 | # error "__cpp_lib_scoped_lock should have the value 201703L in c++20" |
58 | # endif |
59 | # else |
60 | # ifdef __cpp_lib_scoped_lock |
61 | # error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" |
62 | # endif |
63 | # endif |
64 | |
65 | #elif TEST_STD_VER == 23 |
66 | |
67 | # if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS |
68 | # ifndef __cpp_lib_scoped_lock |
69 | # error "__cpp_lib_scoped_lock should be defined in c++23" |
70 | # endif |
71 | # if __cpp_lib_scoped_lock != 201703L |
72 | # error "__cpp_lib_scoped_lock should have the value 201703L in c++23" |
73 | # endif |
74 | # else |
75 | # ifdef __cpp_lib_scoped_lock |
76 | # error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" |
77 | # endif |
78 | # endif |
79 | |
80 | #elif TEST_STD_VER > 23 |
81 | |
82 | # if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS |
83 | # ifndef __cpp_lib_scoped_lock |
84 | # error "__cpp_lib_scoped_lock should be defined in c++26" |
85 | # endif |
86 | # if __cpp_lib_scoped_lock != 201703L |
87 | # error "__cpp_lib_scoped_lock should have the value 201703L in c++26" |
88 | # endif |
89 | # else |
90 | # ifdef __cpp_lib_scoped_lock |
91 | # error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" |
92 | # endif |
93 | # endif |
94 | |
95 | #endif // TEST_STD_VER > 23 |
96 | |
97 | // clang-format on |
98 | |
99 | |