summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/regress/bug1887596.js
blob: 8ff579fc351165a8cce005dcbf66d948205853c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const t = `
    (module
        (func $f (result f32)
            f32.const 1.25
        )
        (table (export "table") 10 funcref)
        (elem (i32.const 0) $f)
    )`;
const i = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary(t)));
const f = i.exports.table.get(0);

// These FP equality comparisons are safe because 1.25 is representable exactly.
assertEq(1.25, f());
assertEq(1.25, this.wasmLosslessInvoke(f).value);