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