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 // typedef atomic<char> atomic_char; 15 // typedef atomic<signed char> atomic_schar; 16 // typedef atomic<unsigned char> atomic_uchar; 17 // typedef atomic<short> atomic_short; 18 // typedef atomic<unsigned short> atomic_ushort; 19 // typedef atomic<int> atomic_int; 20 // typedef atomic<unsigned int> atomic_uint; 21 // typedef atomic<long> atomic_long; 22 // typedef atomic<unsigned long> atomic_ulong; 23 // typedef atomic<long long> atomic_llong; 24 // typedef atomic<unsigned long long> atomic_ullong; 25 // typedef atomic<char16_t> atomic_char16_t; 26 // typedef atomic<char32_t> atomic_char32_t; 27 // typedef atomic<wchar_t> atomic_wchar_t; 28 29 #include <atomic> 30 #include <type_traits> 31 32 int main() 33 { 34 static_assert((std::is_same<std::atomic<char>, std::atomic_char>::value), ""); 35 static_assert((std::is_same<std::atomic<signed char>, std::atomic_schar>::value), ""); 36 static_assert((std::is_same<std::atomic<unsigned char>, std::atomic_uchar>::value), ""); 37 static_assert((std::is_same<std::atomic<short>, std::atomic_short>::value), ""); 38 static_assert((std::is_same<std::atomic<unsigned short>, std::atomic_ushort>::value), ""); 39 static_assert((std::is_same<std::atomic<int>, std::atomic_int>::value), ""); 40 static_assert((std::is_same<std::atomic<unsigned int>, std::atomic_uint>::value), ""); 41 static_assert((std::is_same<std::atomic<long>, std::atomic_long>::value), ""); 42 static_assert((std::is_same<std::atomic<unsigned long>, std::atomic_ulong>::value), ""); 43 static_assert((std::is_same<std::atomic<long long>, std::atomic_llong>::value), ""); 44 static_assert((std::is_same<std::atomic<unsigned long long>, std::atomic_ullong>::value), ""); 45 static_assert((std::is_same<std::atomic<wchar_t>, std::atomic_wchar_t>::value), ""); 46 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS 47 static_assert((std::is_same<std::atomic<char16_t>, std::atomic_char16_t>::value), ""); 48 static_assert((std::is_same<std::atomic<char32_t>, std::atomic_char32_t>::value), ""); 49 #endif // _LIBCPP_HAS_NO_UNICODE_CHARS 50 } 51