summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testBranchingUnstableLoopCounter.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/testBranchingUnstableLoopCounter.js')
-rw-r--r--js/src/jit-test/tests/basic/testBranchingUnstableLoopCounter.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testBranchingUnstableLoopCounter.js b/js/src/jit-test/tests/basic/testBranchingUnstableLoopCounter.js
new file mode 100644
index 0000000000..53fff9e087
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testBranchingUnstableLoopCounter.js
@@ -0,0 +1,11 @@
+function testBranchingUnstableLoopCounter() {
+ var x = 0;
+ for (var i=0; i < 100; ++i) {
+ if (i == 51) {
+ i += 1.1;
+ }
+ x++;
+ }
+ return x;
+}
+assertEq(testBranchingUnstableLoopCounter(), 99);