blob: a945d46352216cd22557bdb8dd637e9fe3d04909 [file] [log] [blame]
//@ skip if $model == "Apple Watch Series 3" # added by mark-jsc-stress-test.py
function foo(length, value) {
var o = {};
o.length = length;
for (var i = 0; i < o.length; ++i)
o[i] = value; // If the array profile is too stochastic then we'll miss the fact that the first iteration has a different indexing type than the subsequent iterations.
for (var i = 0; i < o.length; ++i) {
for (var j = 0; j < o.length; ++j)
o[i] += o[j];
}
return o;
}
function sum(array) {
var result = 0;
for (var i = array.length; i--;)
result += array[i];
return result;
}
var result = 0;
for (var i = 0; i < 10000; ++i)
result += sum(foo(5, i % 42));
if (result != 136889232)
throw "Error: bad result: " + result;