Debian Codegraph @

js/src/jit-test/tests/wasm/regress/bug1887596.js

raw
1 const t = `
2 (module
3 (func $f (result f32)
4 f32.const 1.25
5 )
6 (table (export "table") 10 funcref)
7 (elem (i32.const 0) $f)
8 )`;
9 const i = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary(t)));
10 const f = i.exports.table.get(0);
11
12 // These FP equality comparisons are safe because 1.25 is representable exactly.
13 assertEq(1.25, f());
14 assertEq(1.25, this.wasmLosslessInvoke(f).value);