summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/warp/conditional-test-guard.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/warp/conditional-test-guard.js')
-rw-r--r--js/src/jit-test/tests/warp/conditional-test-guard.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/warp/conditional-test-guard.js b/js/src/jit-test/tests/warp/conditional-test-guard.js
new file mode 100644
index 0000000000..cc2cca8660
--- /dev/null
+++ b/js/src/jit-test/tests/warp/conditional-test-guard.js
@@ -0,0 +1,12 @@
+function f(x) {
+ return (+(x || 1) ? 0 : x);
+}
+
+// Prevent top-level Ion-compilation, so we don't inline |f|.
+with ({});
+
+for (let i = 0; i < 100; ++i) {
+ assertEq(f(), 0);
+}
+
+assertEq(f("not-a-number"), "not-a-number");