summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/trees.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/trees.js')
-rw-r--r--js/src/jit-test/tests/basic/trees.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/trees.js b/js/src/jit-test/tests/basic/trees.js
new file mode 100644
index 000000000..7638f089a
--- /dev/null
+++ b/js/src/jit-test/tests/basic/trees.js
@@ -0,0 +1,10 @@
+function trees() {
+ var i = 0, o = [0,0,0];
+ for (i = 0; i < 100; ++i) {
+ if ((i & 1) == 0) o[0]++;
+ else if ((i & 2) == 0) o[1]++;
+ else o[2]++;
+ }
+ return String(o);
+}
+assertEq(trees(), "50,25,25");