summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug1556571.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/jit-test/tests/ion/bug1556571.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ion/bug1556571.js b/js/src/jit-test/tests/ion/bug1556571.js
new file mode 100644
index 0000000000..b1d69788ca
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug1556571.js
@@ -0,0 +1,14 @@
+// Ensure that convertDoubleToInt32 allows the -0 case.
+
+// If convertDoubleToInt32 fails on the -0 case, then 0 !== -0 below,
+// so it will fall through to the default case.
+function test(v) {
+ switch(v) {
+ case 0: return;
+ default: assertEq(true, false); break;
+ }
+}
+
+for (var i = 0; i < 10000; i++) {
+ test(i % 2 === 0 ? 0 : -0);
+}