Home | History | Annotate | Download | only in atomics.lockfree
      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 // UNSUPPORTED: libcpp-has-no-threads
     11 
     12 // <atomic>
     13 
     14 // #define ATOMIC_BOOL_LOCK_FREE unspecified
     15 // #define ATOMIC_CHAR_LOCK_FREE unspecified
     16 // #define ATOMIC_CHAR16_T_LOCK_FREE unspecified
     17 // #define ATOMIC_CHAR32_T_LOCK_FREE unspecified
     18 // #define ATOMIC_WCHAR_T_LOCK_FREE unspecified
     19 // #define ATOMIC_SHORT_LOCK_FREE unspecified
     20 // #define ATOMIC_INT_LOCK_FREE unspecified
     21 // #define ATOMIC_LONG_LOCK_FREE unspecified
     22 // #define ATOMIC_LLONG_LOCK_FREE unspecified
     23 // #define ATOMIC_POINTER_LOCK_FREE unspecified
     24 
     25 #include <atomic>
     26 #include <cassert>
     27 
     28 int main()
     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     assert(ATOMIC_CHAR16_T_LOCK_FREE == 0 ||
     37            ATOMIC_CHAR16_T_LOCK_FREE == 1 ||
     38            ATOMIC_CHAR16_T_LOCK_FREE == 2);
     39     assert(ATOMIC_CHAR32_T_LOCK_FREE == 0 ||
     40            ATOMIC_CHAR32_T_LOCK_FREE == 1 ||
     41            ATOMIC_CHAR32_T_LOCK_FREE == 2);
     42     assert(ATOMIC_WCHAR_T_LOCK_FREE == 0 ||
     43            ATOMIC_WCHAR_T_LOCK_FREE == 1 ||
     44            ATOMIC_WCHAR_T_LOCK_FREE == 2);
     45     assert(ATOMIC_SHORT_LOCK_FREE == 0 ||
     46            ATOMIC_SHORT_LOCK_FREE == 1 ||
     47            ATOMIC_SHORT_LOCK_FREE == 2);
     48     assert(ATOMIC_INT_LOCK_FREE == 0 ||
     49            ATOMIC_INT_LOCK_FREE == 1 ||
     50            ATOMIC_INT_LOCK_FREE == 2);
     51     assert(ATOMIC_LONG_LOCK_FREE == 0 ||
     52            ATOMIC_LONG_LOCK_FREE == 1 ||
     53            ATOMIC_LONG_LOCK_FREE == 2);
     54     assert(ATOMIC_LLONG_LOCK_FREE == 0 ||
     55            ATOMIC_LLONG_LOCK_FREE == 1 ||
     56            ATOMIC_LLONG_LOCK_FREE == 2);
     57     assert(ATOMIC_POINTER_LOCK_FREE == 0 ||
     58            ATOMIC_POINTER_LOCK_FREE == 1 ||
     59            ATOMIC_POINTER_LOCK_FREE == 2);
     60 }
     61