blob: 8c3f7ff2adf8734a54c4d03d53117bf83cb7b295 [file] [log] [blame]
//@ runBigIntEnabled
function assert(v, e) {
if (v !== e)
throw new Error("Expected value: " + e + " but got: " + v)
}
function bigIntOperations(a, b) {
let c = a - b;
return a - c;
}
noInline(bigIntOperations);
c = 0;
let o = { valueOf: function () {
c++;
return 0b1111n;
}};
for (let i = 0; i < 100000; i++) {
let out = bigIntOperations(o, 0b1010n);
assert(out, 10n);
}
assert(c, 200000);