From 34b258dd692951ab2236e134e5520367cda60125 Mon Sep 17 00:00:00 2001 From: Raghu Gandham Date: Thu, 24 Jul 2014 15:56:51 -0700 Subject: [PATCH] [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. (cherry picked from commit f1837377d215a6eda294b6ac7552b226deee91ce) Change-Id: I973d999c31c9ab89b5a7b709beff6486b93408f2 --- tests/stdatomic_test.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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) {