diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Atomics/isLockFree/bigint/expected-return-value.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Atomics/isLockFree/bigint/expected-return-value.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Atomics/isLockFree/bigint/expected-return-value.js b/js/src/tests/test262/built-ins/Atomics/isLockFree/bigint/expected-return-value.js new file mode 100644 index 0000000000..3d9cb376dc --- /dev/null +++ b/js/src/tests/test262/built-ins/Atomics/isLockFree/bigint/expected-return-value.js @@ -0,0 +1,38 @@ +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-atomics.isLockFree +description: > + Atomics.isLockFree returns a boolean that indicates whether + operations on datum of size will be performed without the agent + acquiring a lock outside of size bytes. +info: | + Atomics.isLockFree( size ) + + 1. Let n be ? ToInteger(size). + 2. Let AR be the Agent Record of the surrounding agent. + 3. If n equals 1, return AR.[[IsLockFree1]]. + 4. If n equals 2, return AR.[[IsLockFree2]]. + 5. If n equals 4, return true. + 6. If n equals 8, return AR.[[IsLockFree8]]. + 7. Return false. + +features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] +includes: [testBigIntTypedArray.js] +---*/ + +testWithBigIntTypedArrayConstructors(function(TA) { + var observed = Atomics.isLockFree(TA.BYTES_PER_ELEMENT); + + assert.sameValue( + Atomics.isLockFree(TA.BYTES_PER_ELEMENT), + observed, + 'Atomics.isLockFree(TA.BYTES_PER_ELEMENT) returns the value of `observed` (Atomics.isLockFree(TA.BYTES_PER_ELEMENT))' + ); +}); + + + +reportCompare(0, 0); |