Skip to content
Snippets Groups Projects
Commit 8b71c5fe authored by Robin Templeton's avatar Robin Templeton Committed by Rick Waldron
Browse files

Atomics tests for BigInt

parent baa5d94b
No related branches found
No related tags found
No related merge requests found
Showing
with 124 additions and 20 deletions
......@@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
......
......@@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);
......
......@@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
......
......@@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);
......
......@@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
......
......@@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);
......
......@@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
......
......@@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);
......
......@@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
......
......@@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);
......
......@@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
......
......@@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);
......
......@@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
......
......@@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);
......
......@@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
......
......@@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);
......
......@@ -5,14 +5,21 @@
esid: sec-atomics.wait
description: >
Test range checking of Atomics.wait on arrays that allow atomic operations
includes: [testAtomics.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of]
includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, TypedArray, arrow-function, let, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var view = new Int32Array(sab);
var sab = new SharedArrayBuffer(8);
var views = [Int32Array];
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
let Idx = IdxGen(view);
assert.throws(RangeError, () => Atomics.wait(view, Idx, 10, 0)); // Even with zero timeout
});
});
}, views);
......@@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);
......
......@@ -5,14 +5,21 @@
esid: sec-atomics.wake
description: >
Test range checking of Atomics.wake on arrays that allow atomic operations
includes: [testAtomics.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of]
includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, TypedArray, arrow-function, let, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var view = new Int32Array(sab);
var sab = new SharedArrayBuffer(8);
var views = [Int32Array];
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
let Idx = IdxGen(view);
assert.throws(RangeError, () => Atomics.wake(view, Idx, 0)); // Even with waking zero
});
});
}, views);
......@@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment