diff --git a/compiler-rt/lib/scudo/standalone/atomic_helpers.h b/compiler-rt/lib/scudo/standalone/atomic_helpers.h --- a/compiler-rt/lib/scudo/standalone/atomic_helpers.h +++ b/compiler-rt/lib/scudo/standalone/atomic_helpers.h @@ -106,14 +106,6 @@ __ATOMIC_RELAXED); } -template -inline bool atomic_compare_exchange_weak(volatile T *A, typename T::Type *Cmp, - typename T::Type Xchg, - memory_order MO) { - return __atomic_compare_exchange(&A->ValDoNotUse, Cmp, &Xchg, true, MO, - __ATOMIC_RELAXED); -} - // Clutter-reducing helpers. template diff --git a/compiler-rt/lib/scudo/standalone/tests/atomic_test.cpp b/compiler-rt/lib/scudo/standalone/tests/atomic_test.cpp --- a/compiler-rt/lib/scudo/standalone/tests/atomic_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/atomic_test.cpp @@ -80,26 +80,14 @@ template void checkAtomicCompareExchange() { typedef typename T::Type Type; - { - Type OldVal = 42; - Type NewVal = 24; - Type V = OldVal; - EXPECT_TRUE(atomic_compare_exchange_strong( - reinterpret_cast(&V), &OldVal, NewVal, memory_order_relaxed)); - EXPECT_FALSE(atomic_compare_exchange_strong( - reinterpret_cast(&V), &OldVal, NewVal, memory_order_relaxed)); - EXPECT_EQ(NewVal, OldVal); - } - { - Type OldVal = 42; - Type NewVal = 24; - Type V = OldVal; - EXPECT_TRUE(atomic_compare_exchange_weak(reinterpret_cast(&V), &OldVal, + Type OldVal = 42; + Type NewVal = 24; + Type V = OldVal; + EXPECT_TRUE(atomic_compare_exchange_strong(reinterpret_cast(&V), &OldVal, NewVal, memory_order_relaxed)); - EXPECT_FALSE(atomic_compare_exchange_weak( - reinterpret_cast(&V), &OldVal, NewVal, memory_order_relaxed)); - EXPECT_EQ(NewVal, OldVal); - } + EXPECT_FALSE(atomic_compare_exchange_strong( + reinterpret_cast(&V), &OldVal, NewVal, memory_order_relaxed)); + EXPECT_EQ(NewVal, OldVal); } TEST(ScudoAtomicTest, AtomicCompareExchangeTest) {