From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../isLockFree/bigint/expected-return-value.js | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 js/src/tests/test262/built-ins/Atomics/isLockFree/bigint/expected-return-value.js (limited to 'js/src/tests/test262/built-ins/Atomics/isLockFree/bigint/expected-return-value.js') 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..3eceb1de2d --- /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); -- cgit v1.2.3