blob: 9971b89d6074d5d1248454c00d431517b0fd8b89 [file] [log] [blame]
//@ skip if $model == "Apple Watch Series 3" # added by mark-jsc-stress-test.py
function sumOfArithSeries(limit) {
return limit * (limit + 1) / 2;
}
var n = 10000000;
function bar() { }
function foo() {
var result = 0;
for (var i = 0; i < n; ++i) {
var o = {f: i};
var p = {f: i + 1};
if (!(i % 100))
bar(o, p);
result += o.f + p.f;
}
return result;
}
noInline(bar);
noInline(foo);
var result = foo();
if (result != sumOfArithSeries(n - 1) + sumOfArithSeries(n))
throw "Error: bad result: " + result;