blob: 4efc3f6b5b7f103857ed3d3755a9620924054e15 [file] [edit]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
function mul(a, b) {
return a * b;
}
noInline(mul);
{
for (var i = 0; i < testLoopCount; ++i)
shouldBe(mul(BigInt(i), 2n), BigInt(i * 2));
}
{
let max = 0x7fffffffn;
let result = 0xfffffffen;
for (var i = 0; i < testLoopCount; ++i)
shouldBe(mul(max, 2n), result);
}