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() { |