summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/call2.js
blob: 9e68bb20ae1a61dc1c57a0ad99f83840af7fa24a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
function g(x) {
    if ((x & 1) == 1) return 1;
    return 2;
}

function f(n) {
    var q = 0;
    for (var i = 0; i < n; i++)
        q += g(i);
    return q;
}

assertEq(f(1000), 1500);