mirror of
https://github.com/tc39/test262.git
synced 2025-09-25 19:18:48 +02:00
Atomics tests for BigInt
This commit is contained in:
parent
baa5d94bc5
commit
8b71c5fea5
@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
|
|||||||
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
|
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];
|
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
views.push(BigInt64Array);
|
||||||
|
views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
let view = new View(sab);
|
let view = new View(sab);
|
||||||
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
||||||
|
@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
|
|||||||
|
|
||||||
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
int_views.push(BigInt64Array);
|
||||||
|
int_views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
var view = new View(ab);
|
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]
|
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];
|
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
views.push(BigInt64Array);
|
||||||
|
views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
let view = new View(sab);
|
let view = new View(sab);
|
||||||
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
||||||
|
@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
|
|||||||
|
|
||||||
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
int_views.push(BigInt64Array);
|
||||||
|
int_views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
var view = new View(ab);
|
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]
|
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];
|
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
views.push(BigInt64Array);
|
||||||
|
views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
let view = new View(sab);
|
let view = new View(sab);
|
||||||
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
||||||
|
@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
|
|||||||
|
|
||||||
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
int_views.push(BigInt64Array);
|
||||||
|
int_views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
var view = new View(ab);
|
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]
|
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];
|
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
views.push(BigInt64Array);
|
||||||
|
views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
let view = new View(sab);
|
let view = new View(sab);
|
||||||
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
||||||
|
@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
|
|||||||
|
|
||||||
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
int_views.push(BigInt64Array);
|
||||||
|
int_views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
var view = new View(ab);
|
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]
|
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];
|
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
views.push(BigInt64Array);
|
||||||
|
views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
let view = new View(sab);
|
let view = new View(sab);
|
||||||
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
||||||
|
@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
|
|||||||
|
|
||||||
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
int_views.push(BigInt64Array);
|
||||||
|
int_views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
var view = new View(ab);
|
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]
|
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];
|
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
views.push(BigInt64Array);
|
||||||
|
views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
let view = new View(sab);
|
let view = new View(sab);
|
||||||
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
||||||
|
@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
|
|||||||
|
|
||||||
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
int_views.push(BigInt64Array);
|
||||||
|
int_views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
var view = new View(ab);
|
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]
|
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];
|
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
views.push(BigInt64Array);
|
||||||
|
views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
let view = new View(sab);
|
let view = new View(sab);
|
||||||
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
||||||
|
@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
|
|||||||
|
|
||||||
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
int_views.push(BigInt64Array);
|
||||||
|
int_views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
var view = new View(ab);
|
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]
|
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];
|
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
views.push(BigInt64Array);
|
||||||
|
views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
let view = new View(sab);
|
let view = new View(sab);
|
||||||
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
||||||
|
@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
|
|||||||
|
|
||||||
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
int_views.push(BigInt64Array);
|
||||||
|
int_views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
var view = new View(ab);
|
var view = new View(ab);
|
||||||
|
|
||||||
|
@ -5,14 +5,21 @@
|
|||||||
esid: sec-atomics.wait
|
esid: sec-atomics.wait
|
||||||
description: >
|
description: >
|
||||||
Test range checking of Atomics.wait on arrays that allow atomic operations
|
Test range checking of Atomics.wait on arrays that allow atomic operations
|
||||||
includes: [testAtomics.js]
|
includes: [testAtomics.js, testTypedArray.js]
|
||||||
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of]
|
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, TypedArray, arrow-function, let, for-of]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var sab = new SharedArrayBuffer(4);
|
var sab = new SharedArrayBuffer(8);
|
||||||
var view = new Int32Array(sab);
|
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);
|
let Idx = IdxGen(view);
|
||||||
assert.throws(RangeError, () => Atomics.wait(view, Idx, 10, 0)); // Even with zero timeout
|
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];
|
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
int_views.push(BigInt64Array);
|
||||||
|
int_views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
var view = new View(ab);
|
var view = new View(ab);
|
||||||
|
|
||||||
|
@ -5,14 +5,21 @@
|
|||||||
esid: sec-atomics.wake
|
esid: sec-atomics.wake
|
||||||
description: >
|
description: >
|
||||||
Test range checking of Atomics.wake on arrays that allow atomic operations
|
Test range checking of Atomics.wake on arrays that allow atomic operations
|
||||||
includes: [testAtomics.js]
|
includes: [testAtomics.js, testTypedArray.js]
|
||||||
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of]
|
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, TypedArray, arrow-function, let, for-of]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var sab = new SharedArrayBuffer(4);
|
var sab = new SharedArrayBuffer(8);
|
||||||
var view = new Int32Array(sab);
|
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);
|
let Idx = IdxGen(view);
|
||||||
assert.throws(RangeError, () => Atomics.wake(view, Idx, 0)); // Even with waking zero
|
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];
|
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
int_views.push(BigInt64Array);
|
||||||
|
int_views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
var view = new View(ab);
|
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]
|
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];
|
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
views.push(BigInt64Array);
|
||||||
|
views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
let view = new View(sab);
|
let view = new View(sab);
|
||||||
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
||||||
|
@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
|
|||||||
|
|
||||||
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
|
||||||
|
|
||||||
|
if (typeof BigInt !== "undefined") {
|
||||||
|
int_views.push(BigInt64Array);
|
||||||
|
int_views.push(BigUint64Array);
|
||||||
|
}
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(View) {
|
testWithTypedArrayConstructors(function(View) {
|
||||||
var view = new View(ab);
|
var view = new View(ab);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user