Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: test/mjsunit/math-abs.js

Issue 1192413002: MIPS64: Fix random failures of fannkuch.js. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments 2. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/math-abs.js
diff --git a/test/mjsunit/math-abs.js b/test/mjsunit/math-abs.js
index b90ae0917c4d513c4d880f8a79e71a895dc7986c..4fb72baaa90bc43b37ce64d4c89d4f07febca2bb 100644
--- a/test/mjsunit/math-abs.js
+++ b/test/mjsunit/math-abs.js
@@ -120,3 +120,19 @@ assertEquals(1, foo2());
assertEquals(1, foo2());
%OptimizeFunctionOnNextCall(foo2);
assertEquals(1, foo2());
+
+// Regression test for Integer input of Math.abs on mips64.
+function absHalf(bits) {
+ var x = 1 << (bits - 1);
+ var half = Math.abs(x);
+ return half;
+
+}
+
+// Create minimum integer input for abs() using bitwise operations
+// that should overflow.
+bits = 32;
+assertEquals(2147483648, absHalf(bits));
+assertEquals(2147483648, absHalf(bits));
+%OptimizeFunctionOnNextCall(absHalf);
+assertEquals(2147483648, absHalf(bits));
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698