blob: 5c6ad26d08dda92875962117490ffe11680d92e2 [file] [log] [blame]
//@ skip if $model == "Apple Watch Series 3" # added by mark-jsc-stress-test.py
function mathTruncInt(i)
{
return Math.trunc(i);
}
noInline(mathTruncInt);
for (var i = 0; i < 1e5; ++i)
mathTruncInt(i);
function mathTruncDouble(i)
{
return Math.trunc(i);
}
noInline(mathTruncDouble);
for (var i = 0; i < 1e5; ++i)
mathTruncDouble(i * 0.6);
function mathTruncMixed(i)
{
return Math.trunc(i);
}
noInline(mathTruncMixed);
for (var i = 0; i < 1e5; ++i) {
if (i % 2 === 0)
mathTruncDouble(i * 0.6);
else
mathTruncDouble(i);
}
function mathTruncDoubleDoesNotCareNegativeZero(i)
{
return Math.trunc(i) | 0;
}
noInline(mathTruncDoubleDoesNotCareNegativeZero);
for (var i = 0; i < 1e5; ++i)
mathTruncDoubleDoesNotCareNegativeZero(i * 0.6);