summaryrefslogtreecommitdiff
path: root/tests/stdatomic_test.cpp
diff options
context:
space:
mode:
authorRaghu Gandham <raghu.gandham@imgtec.com>2014-07-24 15:56:51 -0700
committerRaghu Gandham <raghu.gandham@imgtec.com>2014-07-24 16:11:52 -0700
commitf1837377d215a6eda294b6ac7552b226deee91ce (patch)
tree25b90a8974590f4ad874105c8d0cc93950464e64 /tests/stdatomic_test.cpp
parentdbf52ec37b835973d8f357af2a16694c98894c4d (diff)
[MIPS] Fix atomic_is_lock_free test for mips32.
On 32-bit MIPS, 64-bit atomic ops are achieved through locks. So allow the test to fail for atomic_intmax_t on 32-bit MIPS. Change-Id: I78e7807e50f899a0fea0d5b388d9ebb53228aaa0
Diffstat (limited to 'tests/stdatomic_test.cpp')
-rw-r--r--tests/stdatomic_test.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/stdatomic_test.cpp b/tests/stdatomic_test.cpp
index d41bfa92e..5e88c8801 100644
--- a/tests/stdatomic_test.cpp
+++ b/tests/stdatomic_test.cpp
@@ -66,7 +66,12 @@ TEST(stdatomic, atomic_is_lock_free) {
atomic_char small;
atomic_intmax_t big;
ASSERT_TRUE(atomic_is_lock_free(&small));
+ // 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
}
TEST(stdatomic, atomic_flag) {