Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Unified Diff: test/cctest/test-atomicops.cc

Issue 228613005: Introduced Atomic8 and added no-barrier Atomic8 accessors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/atomicops_internals_x86_msvc.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-atomicops.cc
diff --git a/test/cctest/test-atomicops.cc b/test/cctest/test-atomicops.cc
index eba956c859c08c6d6710c68df5dad4e9e6f2064c..53df22963dd3e48da2d50ed09e1c2d22305dd3b4 100644
--- a/test/cctest/test-atomicops.cc
+++ b/test/cctest/test-atomicops.cc
@@ -214,6 +214,21 @@ static void TestStore() {
}
+// Merge this test with TestStore as soon as we have Atomic8 acquire
+// and release stores.
+static void TestStoreAtomic8() {
+ const Atomic8 kVal1 = TestFillValue<Atomic8>();
+ const Atomic8 kVal2 = static_cast<Atomic8>(-1);
+
+ Atomic8 value;
+
+ NoBarrier_Store(&value, kVal1);
+ CHECK_EQU(kVal1, value);
+ NoBarrier_Store(&value, kVal2);
+ CHECK_EQU(kVal2, value);
+}
+
+
// This is a simple sanity check to ensure that values are correct.
// Not testing atomicity.
template <class AtomicType>
@@ -240,6 +255,21 @@ static void TestLoad() {
}
+// Merge this test with TestLoad as soon as we have Atomic8 acquire
+// and release loads.
+static void TestLoadAtomic8() {
+ const Atomic8 kVal1 = TestFillValue<Atomic8>();
+ const Atomic8 kVal2 = static_cast<Atomic8>(-1);
+
+ Atomic8 value;
+
+ value = kVal1;
+ CHECK_EQU(kVal1, NoBarrier_Load(&value));
+ value = kVal2;
+ CHECK_EQU(kVal2, NoBarrier_Load(&value));
+}
+
+
TEST(AtomicIncrement) {
TestAtomicIncrement<Atomic32>();
TestAtomicIncrement<AtomicWord>();
@@ -265,12 +295,14 @@ TEST(AtomicIncrementBounds) {
TEST(Store) {
+ TestStoreAtomic8();
TestStore<Atomic32>();
TestStore<AtomicWord>();
}
TEST(Load) {
+ TestLoadAtomic8();
TestLoad<Atomic32>();
TestLoad<AtomicWord>();
}
« no previous file with comments | « src/atomicops_internals_x86_msvc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698