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 | // <atomic> |
10 | |
11 | // #define ATOMIC_BOOL_LOCK_FREE unspecified |
12 | // #define ATOMIC_CHAR_LOCK_FREE unspecified |
13 | // #define ATOMIC_CHAR8_T_LOCK_FREE unspecified // C++20 |
14 | // #define ATOMIC_CHAR16_T_LOCK_FREE unspecified |
15 | // #define ATOMIC_CHAR32_T_LOCK_FREE unspecified |
16 | // #define ATOMIC_WCHAR_T_LOCK_FREE unspecified |
17 | // #define ATOMIC_SHORT_LOCK_FREE unspecified |
18 | // #define ATOMIC_INT_LOCK_FREE unspecified |
19 | // #define ATOMIC_LONG_LOCK_FREE unspecified |
20 | // #define ATOMIC_LLONG_LOCK_FREE unspecified |
21 | // #define ATOMIC_POINTER_LOCK_FREE unspecified |
22 | |
23 | #include <atomic> |
24 | #include <cassert> |
25 | |
26 | #include "test_macros.h" |
27 | |
28 | int main(int, char**) |
29 | { |
30 | assert(ATOMIC_BOOL_LOCK_FREE == 0 || |
31 | ATOMIC_BOOL_LOCK_FREE == 1 || |
32 | ATOMIC_BOOL_LOCK_FREE == 2); |
33 | assert(ATOMIC_CHAR_LOCK_FREE == 0 || |
34 | ATOMIC_CHAR_LOCK_FREE == 1 || |
35 | ATOMIC_CHAR_LOCK_FREE == 2); |
36 | #if TEST_STD_VER > 17 && defined(__cpp_char8_t) |
37 | assert(ATOMIC_CHAR8_T_LOCK_FREE == 0 || |
38 | ATOMIC_CHAR8_T_LOCK_FREE == 1 || |
39 | ATOMIC_CHAR8_T_LOCK_FREE == 2); |
40 | #endif |
41 | assert(ATOMIC_CHAR16_T_LOCK_FREE == 0 || |
42 | ATOMIC_CHAR16_T_LOCK_FREE == 1 || |
43 | ATOMIC_CHAR16_T_LOCK_FREE == 2); |
44 | assert(ATOMIC_CHAR32_T_LOCK_FREE == 0 || |
45 | ATOMIC_CHAR32_T_LOCK_FREE == 1 || |
46 | ATOMIC_CHAR32_T_LOCK_FREE == 2); |
47 | assert(ATOMIC_WCHAR_T_LOCK_FREE == 0 || |
48 | ATOMIC_WCHAR_T_LOCK_FREE == 1 || |
49 | ATOMIC_WCHAR_T_LOCK_FREE == 2); |
50 | assert(ATOMIC_SHORT_LOCK_FREE == 0 || |
51 | ATOMIC_SHORT_LOCK_FREE == 1 || |
52 | ATOMIC_SHORT_LOCK_FREE == 2); |
53 | assert(ATOMIC_INT_LOCK_FREE == 0 || |
54 | ATOMIC_INT_LOCK_FREE == 1 || |
55 | ATOMIC_INT_LOCK_FREE == 2); |
56 | assert(ATOMIC_LONG_LOCK_FREE == 0 || |
57 | ATOMIC_LONG_LOCK_FREE == 1 || |
58 | ATOMIC_LONG_LOCK_FREE == 2); |
59 | assert(ATOMIC_LLONG_LOCK_FREE == 0 || |
60 | ATOMIC_LLONG_LOCK_FREE == 1 || |
61 | ATOMIC_LLONG_LOCK_FREE == 2); |
62 | assert(ATOMIC_POINTER_LOCK_FREE == 0 || |
63 | ATOMIC_POINTER_LOCK_FREE == 1 || |
64 | ATOMIC_POINTER_LOCK_FREE == 2); |
65 | |
66 | return 0; |
67 | } |
68 |