summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testBug762105.js
blob: 147a87eac033579e93e2ef1d557af7fd8681389b (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
30
31
32
33
function escapeme() {}

function f1(x) {
    escapeme(arguments);
    var y = ++x;
    return x + y;
}
for (var i = 0; i < 100; ++i)
    assertEq(f1(2), 6);

function f2(x) {
    escapeme(arguments);
    var y = --x;
    return x + y;
}
for (var i = 0; i < 100; ++i)
    assertEq(f2(2), 2);

function f3(x) {
    escapeme(arguments);
    var y = x++;
    return x + y;
}
for (var i = 0; i < 100; ++i)
    assertEq(f3(2), 5);

function f4(x) {
    escapeme(arguments);
    var y = x--;
    return x + y;
}
for (var i = 0; i < 100; ++i)
    assertEq(f4(2), 3);