blob: d73936c717e44c49f09332e5d9d6efd8c6682fb9 [file] [log] [blame]
function foo(p, a, b) {
var result = 0;
for (var i = 0; i < 1000; ++i) {
if (p)
result += a + b;
else
result += a - b;
}
return result;
}
noInline(foo);
var result = 0;
for (var i = 0; i < 1000; ++i) {
result += foo(true, 1, 2);
result += foo(false, 2000000000, 2000000000);
}
for (var i = 0; i < 10000; ++i)
result += foo(false, 2000000000, 2000000000);
for (var i = 0; i < 10000; ++i)
result += foo(true, 1, 2);
if (result != 33000000)
throw "Error: bad result: " + result;