summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testBranchingLoop.js
blob: 5c302425fe633ae1b078ad6534463897ac77b6eb (plain)
1
2
3
4
5
6
7
8
9
10
11
function testBranchingLoop() {
  var x = 0;
  for (var i=0; i < 100; ++i) {
    if (i == 51) {
      x += 10;
    }
    x++;
  }
  return x;
}
assertEq(testBranchingLoop(), 110);