blob: 92f1f2051d4ff539c1f2d8c958e664765b34f259 [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
function inc(a) {
return ++a;
}
noInline(inc);
{
for (var i = 0; i < 100000; ++i)
shouldBe(inc(BigInt(i)), BigInt(i + 1));
}
{
let max = 0x7fffffffn;
let result = 0x80000000n;
for (var i = 0; i < 100000; ++i)
shouldBe(inc(max), result);
}