summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/arithstringtonumber.js
blob: 56fb119decc2a1b29e68ab79812b18cefe0a2fd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var g_array = [0, 1];

function g(p) {
  p = p - 0;
  return g_array[p - 0];
}

function f() {
  var q = 0;
  for (var i = 0; i < 10; ++i) {
    q += g("0x0");
    q += g("0x1");
  }
  return q;
}

for (var j = 0; j < 2; ++j) {
  assertEq(f(), 10);
}