summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Atomics/isLockFree/bigint/expected-return-value.js
blob: 3eceb1de2dc3c2b300b55678618d9750f0077ea4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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);