• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // <atomic>
11 
12 // #define ATOMIC_CHAR_LOCK_FREE unspecified
13 // #define ATOMIC_CHAR16_T_LOCK_FREE unspecified
14 // #define ATOMIC_CHAR32_T_LOCK_FREE unspecified
15 // #define ATOMIC_WCHAR_T_LOCK_FREE unspecified
16 // #define ATOMIC_SHORT_LOCK_FREE unspecified
17 // #define ATOMIC_INT_LOCK_FREE unspecified
18 // #define ATOMIC_LONG_LOCK_FREE unspecified
19 // #define ATOMIC_LLONG_LOCK_FREE unspecified
20 
21 #include <atomic>
22 #include <cassert>
23 
main()24 int main()
25 {
26     assert(ATOMIC_CHAR_LOCK_FREE == 0 ||
27            ATOMIC_CHAR_LOCK_FREE == 1 ||
28            ATOMIC_CHAR_LOCK_FREE == 2);
29     assert(ATOMIC_CHAR16_T_LOCK_FREE == 0 ||
30            ATOMIC_CHAR16_T_LOCK_FREE == 1 ||
31            ATOMIC_CHAR16_T_LOCK_FREE == 2);
32     assert(ATOMIC_CHAR32_T_LOCK_FREE == 0 ||
33            ATOMIC_CHAR32_T_LOCK_FREE == 1 ||
34            ATOMIC_CHAR32_T_LOCK_FREE == 2);
35     assert(ATOMIC_WCHAR_T_LOCK_FREE == 0 ||
36            ATOMIC_WCHAR_T_LOCK_FREE == 1 ||
37            ATOMIC_WCHAR_T_LOCK_FREE == 2);
38     assert(ATOMIC_SHORT_LOCK_FREE == 0 ||
39            ATOMIC_SHORT_LOCK_FREE == 1 ||
40            ATOMIC_SHORT_LOCK_FREE == 2);
41     assert(ATOMIC_INT_LOCK_FREE == 0 ||
42            ATOMIC_INT_LOCK_FREE == 1 ||
43            ATOMIC_INT_LOCK_FREE == 2);
44     assert(ATOMIC_LONG_LOCK_FREE == 0 ||
45            ATOMIC_LONG_LOCK_FREE == 1 ||
46            ATOMIC_LONG_LOCK_FREE == 2);
47     assert(ATOMIC_LLONG_LOCK_FREE == 0 ||
48            ATOMIC_LLONG_LOCK_FREE == 1 ||
49            ATOMIC_LLONG_LOCK_FREE == 2);
50 }
51