blob: 02a66d3b8cd7db42019d5b7546d44b5cd176fa8c [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, 40n);
}
assert(c, 200000);