blob: a3b5f5327913b073069096df292f4a4eb52d92f5 [file] [log] [blame]
//@ skip if $model == "Apple Watch Series 3" # added by mark-jsc-stress-test.py
function foo(o) {
var result = 0;
for (var i = 0; i < 100; ++i)
result += o.f;
return result;
}
noInline(foo);
var o = {f:1, g:2};
var p = {g:1, f:2};
for (var i = 0; i < 10000; ++i) {
var result = foo((i & 1) ? o : p);
if (result != ((i & 1) ? 100 : 200))
throw "Error: bad result for i = " + i + ": " + result;
}
var q = {g:3, h:4, f:5};
var result = foo(q);
if (result != 500)
throw "Error: bad result at end: " + result;