summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug703376.js
blob: cc88c6011cf1ec7d8e12571819bf0a797765f793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var global = 1;

function test1(x) {
    global = 2;
    var k = global;
    global = x;
    global = x + 1;
    k = global + global;
    return k;
}

for (var i=0; i<60; i++) {
    assertEq(test1(i), i + 1 + i + 1);
}

function test2(x) {
    global = 2;
    var k = global;

    for (var i=0; i<10; i++) {
        k = global;
        global = i + x;
    }
    return k;
}

for (i=0; i<50; i++) {
    assertEq(test2(i), i + 8);
}