Index: runtime/vm/atomic_test.cc |
diff --git a/runtime/vm/atomic_test.cc b/runtime/vm/atomic_test.cc |
index 6973d8b42a03c14a8ead95c8ca2e7e1935166d9e..262a3284b909e1b5f6726dea50a8a97484d03b99 100644 |
--- a/runtime/vm/atomic_test.cc |
+++ b/runtime/vm/atomic_test.cc |
@@ -26,6 +26,22 @@ UNIT_TEST_CASE(FetchAndDecrement) { |
} |
+UNIT_TEST_CASE(FetchAndIncrementSigned) { |
+ intptr_t v = -42; |
+ EXPECT_EQ(static_cast<intptr_t>(-42), |
+ AtomicOperations::FetchAndIncrement(&v)); |
+ EXPECT_EQ(static_cast<intptr_t>(-41), v); |
+} |
+ |
+ |
+UNIT_TEST_CASE(FetchAndDecrementSigned) { |
+ intptr_t v = -42; |
+ EXPECT_EQ(static_cast<intptr_t>(-42), |
+ AtomicOperations::FetchAndDecrement(&v)); |
+ EXPECT_EQ(static_cast<intptr_t>(-43), v); |
+} |
+ |
+ |
UNIT_TEST_CASE(IncrementBy) { |
intptr_t v = 42; |
AtomicOperations::IncrementBy(&v, 100); |