blob: 0f2ba0b941e283908cb38571eec94e43406af216 [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];
}
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);