blob: 233a229a2c7b01589d81a1f699182018b69c849d [file] [log] [blame]
//@ skip if $model == "Apple Watch Series 3" # added by mark-jsc-stress-test.py
var array = new Int32Array(1);
function foo(value) {
array[0] = value;
return array[0];
}
noInline(foo);
function test(input, output) {
var result = foo(input);
if (result != output)
throw "Error: " + input + " was supposed to result in " + output + " but instead got " + result;
}
for (var i = 0; i < 100000; ++i)
test(i + 0.5, i);
test(0, 0);
test(100.5, 100);
test(-100.5, -100);
test(3000000000, -1294967296);
test(-3000000000, 1294967296);
test(-2147483648, -2147483648);