summaryrefslogtreecommitdiffstats
path: root/tests/stdatomic_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdatomic_test.cpp')
-rw-r--r--tests/stdatomic_test.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/stdatomic_test.cpp b/tests/stdatomic_test.cpp
index 222bd9c..b7fb19b 100644
--- a/tests/stdatomic_test.cpp
+++ b/tests/stdatomic_test.cpp
@@ -63,14 +63,17 @@ TEST(stdatomic, atomic_signal_fence) {
TEST(stdatomic, atomic_is_lock_free) {
atomic_char small;
- atomic_intmax_t big;
ASSERT_TRUE(atomic_is_lock_free(&small));
+#if defined(__clang__) || __GNUC_PREREQ(4, 7)
+ // Otherwise stdatomic.h doesn't handle this.
+ atomic_intmax_t big;
// atomic_intmax_t(size = 64) is not lock free on mips32.
#if defined(__mips__) && !defined(__LP64__)
ASSERT_FALSE(atomic_is_lock_free(&big));
#else
ASSERT_TRUE(atomic_is_lock_free(&big));
#endif
+#endif
}
TEST(stdatomic, atomic_flag) {