Chromium Code Reviews| Index: tests/toolchain/synchronization_cpp11.cc |
| diff --git a/tests/toolchain/synchronization_cpp11.cc b/tests/toolchain/synchronization_cpp11.cc |
| index 9f26a717954075ecd62ab8e46f9d63966ae55593..4a127a56c3827580e8fad07e62c1e137a3237f6b 100644 |
| --- a/tests/toolchain/synchronization_cpp11.cc |
| +++ b/tests/toolchain/synchronization_cpp11.cc |
| @@ -46,6 +46,7 @@ |
| * lock-free: we can't guarantee that all our platforms are lock-free. |
| */ |
| void test_lock_free_macros() { |
| +#if defined(__pnacl__) |
| static_assert(ATOMIC_BOOL_LOCK_FREE == 1, "should be compile-time 1"); |
| static_assert(ATOMIC_CHAR_LOCK_FREE == 1, "should be compile-time 1"); |
| static_assert(ATOMIC_CHAR16_T_LOCK_FREE == 1, "should be compile-time 1"); |
| @@ -56,6 +57,18 @@ void test_lock_free_macros() { |
| static_assert(ATOMIC_LONG_LOCK_FREE == 1, "should be compile-time 1"); |
| static_assert(ATOMIC_LLONG_LOCK_FREE == 1, "should be compile-time 1"); |
| static_assert(ATOMIC_POINTER_LOCK_FREE == 1, "should be compile-time 1"); |
| +#elif defined(__x86_64__) || defined(__i386__) || defined(__arm__) |
| + static_assert(ATOMIC_BOOL_LOCK_FREE == 2, "should be compile-time 2"); |
| + static_assert(ATOMIC_CHAR_LOCK_FREE == 2, "should be compile-time 2"); |
| + static_assert(ATOMIC_CHAR16_T_LOCK_FREE == 2, "should be compile-time 2"); |
| + static_assert(ATOMIC_CHAR32_T_LOCK_FREE == 2, "should be compile-time 2"); |
| + static_assert(ATOMIC_WCHAR_T_LOCK_FREE == 2, "should be compile-time 2"); |
| + static_assert(ATOMIC_SHORT_LOCK_FREE == 2, "should be compile-time 2"); |
| + static_assert(ATOMIC_INT_LOCK_FREE == 2, "should be compile-time 2"); |
| + static_assert(ATOMIC_LONG_LOCK_FREE == 2, "should be compile-time 2"); |
| + static_assert(ATOMIC_LLONG_LOCK_FREE == 2, "should be compile-time 2"); |
| + static_assert(ATOMIC_POINTER_LOCK_FREE == 2, "should be compile-time 2"); |
|
jvoung (off chromium)
2014/10/08 22:40:23
#else ...
// TODO other architectures like mips.
Derek Schuff
2014/10/09 16:55:42
Done.
Yeah there may well never be a non-pnacl mip
|
| +#endif |
| } |
| #define TEST_IS_LOCK_FREE(TYPE) do { \ |