Debian Codegraph @

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

raw
1 let module = new WebAssembly.Module(wasmTextToBinary(`(module
2 (func (export "rshift") (param $x i64) (result i64)
3 local.get $x
4 local.get $x
5 i64.shr_s
6 ))`));
7
8 let instance = new WebAssembly.Instance(module);
9
10 let {rshift} = instance.exports;
11
12 for (let i = 0; i < 100; ++i) {
13 // Input which uses both int64 register pairs on 32-bit systems.
14 let x = BigInt(i) + 0x1_0000_0000n;
15
16 assertEq(rshift(x), BigInt.asIntN(64, x >> (x & 63n)));
17 }