diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2016-06-30 15:28:38 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2016-06-30 15:28:38 +0000 |
| commit | e766a87b0170fe9a1ecc1a776fef43bf27aa1294 (patch) | |
| tree | ba67442659006b12a6bd69e6fb322af44c8b0a01 /libcxx/test/std | |
| parent | 497677449be6f4a19b6b692dccab3b23e7cfd872 (diff) | |
| download | bcm5719-llvm-e766a87b0170fe9a1ecc1a776fef43bf27aa1294.tar.gz bcm5719-llvm-e766a87b0170fe9a1ecc1a776fef43bf27aa1294.zip | |
Implement LWG#2441: 'Exact-width atomic typedefs should be provided'
llvm-svn: 274236
Diffstat (limited to 'libcxx/test/std')
3 files changed, 51 insertions, 0 deletions
diff --git a/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp index c14c60a9c33..a449dc6d5f5 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp @@ -185,6 +185,15 @@ int main() #endif // _LIBCPP_HAS_NO_UNICODE_CHARS test<std::atomic_wchar_t, wchar_t>(); + test<std::atomic_int8_t, int8_t>(); + test<std::atomic_uint8_t, uint8_t>(); + test<std::atomic_int16_t, int16_t>(); + test<std::atomic_uint16_t, uint16_t>(); + test<std::atomic_int32_t, int32_t>(); + test<std::atomic_uint32_t, uint32_t>(); + test<std::atomic_int64_t, int64_t>(); + test<std::atomic_uint64_t, uint64_t>(); + test<volatile std::atomic_char, char>(); test<volatile std::atomic_schar, signed char>(); test<volatile std::atomic_uchar, unsigned char>(); @@ -201,4 +210,13 @@ int main() test<volatile std::atomic_char32_t, char32_t>(); #endif // _LIBCPP_HAS_NO_UNICODE_CHARS test<volatile std::atomic_wchar_t, wchar_t>(); + + test<volatile std::atomic_int8_t, int8_t>(); + test<volatile std::atomic_uint8_t, uint8_t>(); + test<volatile std::atomic_int16_t, int16_t>(); + test<volatile std::atomic_uint16_t, uint16_t>(); + test<volatile std::atomic_int32_t, int32_t>(); + test<volatile std::atomic_uint32_t, uint32_t>(); + test<volatile std::atomic_int64_t, int64_t>(); + test<volatile std::atomic_uint64_t, uint64_t>(); } diff --git a/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp index e8fae85fb4b..e4deae1bf0d 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp @@ -25,6 +25,18 @@ // typedef atomic<char16_t> atomic_char16_t; // typedef atomic<char32_t> atomic_char32_t; // typedef atomic<wchar_t> atomic_wchar_t; +// +// typedef atomic<intptr_t> atomic_intptr_t; +// typedef atomic<uintptr_t> atomic_uintptr_t; +// +// typedef atomic<int8_t> atomic_int8_t; +// typedef atomic<uint8_t> atomic_uint8_t; +// typedef atomic<int16_t> atomic_int16_t; +// typedef atomic<uint16_t> atomic_uint16_t; +// typedef atomic<int32_t> atomic_int32_t; +// typedef atomic<uint32_t> atomic_uint32_t; +// typedef atomic<int64_t> atomic_int64_t; +// typedef atomic<uint64_t> atomic_uint64_t; #include <atomic> #include <type_traits> @@ -47,4 +59,17 @@ int main() static_assert((std::is_same<std::atomic<char16_t>, std::atomic_char16_t>::value), ""); static_assert((std::is_same<std::atomic<char32_t>, std::atomic_char32_t>::value), ""); #endif // _LIBCPP_HAS_NO_UNICODE_CHARS + +// Added by LWG 2441 + static_assert((std::is_same<std::atomic<intptr_t>, std::atomic_intptr_t>::value), ""); + static_assert((std::is_same<std::atomic<uintptr_t>, std::atomic_uintptr_t>::value), ""); + + static_assert((std::is_same<std::atomic<int8_t>, std::atomic_int8_t>::value), ""); + static_assert((std::is_same<std::atomic<uint8_t>, std::atomic_uint8_t>::value), ""); + static_assert((std::is_same<std::atomic<int16_t>, std::atomic_int16_t>::value), ""); + static_assert((std::is_same<std::atomic<uint16_t>, std::atomic_uint16_t>::value), ""); + static_assert((std::is_same<std::atomic<int32_t>, std::atomic_int32_t>::value), ""); + static_assert((std::is_same<std::atomic<uint32_t>, std::atomic_uint32_t>::value), ""); + static_assert((std::is_same<std::atomic<int64_t>, std::atomic_int64_t>::value), ""); + static_assert((std::is_same<std::atomic<uint64_t>, std::atomic_uint64_t>::value), ""); } diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_helpers.h b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_helpers.h index 2fb71c2a5fe..482b7319dab 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_helpers.h +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_helpers.h @@ -43,6 +43,14 @@ struct TestEachIntegralType { TestFunctor<char16_t>()(); TestFunctor<char32_t>()(); #endif + TestFunctor< int8_t>()(); + TestFunctor< uint8_t>()(); + TestFunctor< int16_t>()(); + TestFunctor<uint16_t>()(); + TestFunctor< int32_t>()(); + TestFunctor<uint32_t>()(); + TestFunctor< int64_t>()(); + TestFunctor<uint64_t>()(); } }; |

