Index: runtime/vm/atomic_test.cc |
diff --git a/runtime/vm/atomic_test.cc b/runtime/vm/atomic_test.cc |
index 5e22606047e83c6b6bb253fce715d332352ccabd..e7e366641f92332e5fdba0e282614a75af891ece 100644 |
--- a/runtime/vm/atomic_test.cc |
+++ b/runtime/vm/atomic_test.cc |
@@ -31,4 +31,22 @@ UNIT_TEST_CASE(LoadRelaxed) { |
EXPECT_EQ(static_cast<uword>(42), AtomicOperations::LoadRelaxed(&v)); |
} |
+ |
+UNIT_TEST_CASE(CompareAndSwapWord) { |
+ uword old_value = 42; |
+ uword new_value = 100; |
+ uword result = AtomicOperations::CompareAndSwapWord( |
+ &old_value, old_value, new_value); |
+ EXPECT_EQ(static_cast<uword>(42), result); |
+} |
+ |
+ |
+UNIT_TEST_CASE(CompareAndSwapUint32) { |
+ uint32_t old_value = 42; |
+ uint32_t new_value = 100; |
+ uint32_t result = AtomicOperations::CompareAndSwapUint32( |
+ &old_value, old_value, new_value); |
+ EXPECT_EQ(static_cast<uint32_t>(42), result); |
+} |
+ |
} // namespace dart |