Bug 1528829 - Add test case to check range analysis correctness. r=jandem
authorNicolas B. Pierron <nicolas.b.pierron@nbp.name>
Thu, 21 Mar 2019 19:37:58 +0000
changeset 468988 b2bc140a4d766e6b86d85b77e2bc12733402dc27
parent 468987 5d5e4df2976a4649e0a717f75c5f311ea1385046
child 468989 cec02915533974e9ad62aad07838cdbfdb477f15
push id35856
push usercsabou@mozilla.com
push dateFri, 12 Apr 2019 03:19:48 +0000
treeherdermozilla-central@940684cd1065 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1528829
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528829 - Add test case to check range analysis correctness. r=jandem Differential Revision: https://phabricator.services.mozilla.com/D21930
js/src/jit-test/tests/ion/fold-linear-arith-bug1528829.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/fold-linear-arith-bug1528829.js
@@ -0,0 +1,18 @@
+// |jit-test| --ion-warmup-threshold=0; --ion-check-range-analysis
+
+function f(o) {
+    // Int32 math does an overflow check.
+    o += 1;
+    // Int32 math does an underflow check.
+    o += -2147483647;
+    // If previous math operations are folded, we should keep the smallest
+    // overflow check and the highest underflow check to stay within the
+    // expected range deduced by Range Analysis.
+    for (let i = 0; i < 1; ++i) {
+        o -= 1;
+    }
+}
+f(0);
+f(0);
+f(2147483647);
+