summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug1762343.js
blob: 7e07c5e886ad2640ed27f5b4579498a363fef1e7 (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
// |jit-test| --fast-warmup; --no-threads

function placeholder() {}

function main() {
  const fhash = placeholder;
  const v9 = -62980826;

  let v21;
  for (let i = 0; i < 32; i++) {
    // Call Math.fround() to enable the Float32 specialization pass.
    Math.fround(123);

    // Math.trunc() can produce Float32.
    const v18 = Math.trunc(-9007199254740992);

    // |valueOf| is always true, but can't be inferred at compile-time.
    const v20 = valueOf ? v18 : -9007199254740992;

    // Use the Float32 value.
    v21 = v20 && v9;
  }

  assertEq(v21, -62980826);
}

main();