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

Unified Diff: test/mjsunit/harmony/atomics.js

Issue 1617503003: [Atomics] code stubs for atomic operations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove unnecessary CSA additions Created 4 years, 10 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
« src/compiler/code-stub-assembler.cc ('K') | « test/mjsunit/asm/atomics-load.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/atomics.js
diff --git a/test/mjsunit/harmony/atomics.js b/test/mjsunit/harmony/atomics.js
index 4b9c9f6c663a3951c4dfaeefab6fb211a4ffc810..f835e5f07d7521b958449518d01b5c8a7fd70589 100644
--- a/test/mjsunit/harmony/atomics.js
+++ b/test/mjsunit/harmony/atomics.js
@@ -210,6 +210,24 @@ function clearArray(sab) {
}
})
});
+
+ // Test Smi range
+ (function () {
+ var sab = new SharedArrayBuffer(4);
+ var i32 = new Int32Array(sab);
+ var u32 = new Uint32Array(sab);
+
+ function testLoad(signedValue, unsignedValue) {
+ u32[0] = unsignedValue;
+ assertEquals(unsignedValue, Atomics.load(u32, 0));
+ assertEquals(signedValue, Atomics.load(i32, 0));
+ }
+
+ testLoad(0x3fffffff, 0x3fffffff); // 2**30-1 (always smi)
+ testLoad(0x40000000, 0x40000000); // 2**30 (smi if signed and 32-bits)
+ testLoad(0x80000000, -0x80000000); // 2**31 (smi if signed and 32-bits)
+ testLoad(0xffffffff, -1); // 2**31 (smi if signed)
+ });
})();
(function TestStore() {
« src/compiler/code-stub-assembler.cc ('K') | « test/mjsunit/asm/atomics-load.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698