1 2 //===----------------------------------------------------------------------===// 3 // 4 // The LLVM Compiler Infrastructure 5 // 6 // This file is dual licensed under the MIT and the University of Illinois Open 7 // Source Licenses. See LICENSE.TXT for details. 8 // 9 //===----------------------------------------------------------------------===// 10 // 11 // <atomic> feature macros 12 13 /* Constant Value 14 __cpp_lib_char8_t 201811L 15 __cpp_lib_atomic_is_always_lock_free 201603L 16 __cpp_lib_atomic_ref 201806L 17 18 */ 19 20 // UNSUPPORTED: libcpp-has-no-threads 21 22 #include <atomic> 23 #include <cassert> 24 #include "test_macros.h" 25 main()26int main() 27 { 28 // ensure that the macros that are supposed to be defined in <atomic> are defined. 29 30 #if TEST_STD_VER > 17 && defined(__cpp_char8_t) 31 # if !defined(__cpp_lib_char8_t) 32 LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined"); 33 # else 34 # if __cpp_lib_char8_t < 201811L 35 # error "__cpp_lib_char8_t has an invalid value" 36 # endif 37 # endif 38 #endif 39 40 #if TEST_STD_VER > 14 41 # if !defined(__cpp_lib_atomic_is_always_lock_free) 42 # error "__cpp_lib_atomic_is_always_lock_free is not defined" 43 # elif __cpp_lib_atomic_is_always_lock_free < 201603L 44 # error "__cpp_lib_atomic_is_always_lock_free has an invalid value" 45 # endif 46 #endif 47 48 /* 49 #if !defined(__cpp_lib_fooby) 50 # error "__cpp_lib_fooby is not defined" 51 #elif __cpp_lib_fooby < 201606L 52 # error "__cpp_lib_fooby has an invalid value" 53 #endif 54 */ 55 } 56