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

Unified Diff: test/mjsunit/regress/regress-164442.js

Issue 11665007: Fix x64 MathMinMax for negative untagged int32 arguments. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-164442.js
diff --git a/test/mjsunit/regress/regress-sqrt.js b/test/mjsunit/regress/regress-164442.js
similarity index 86%
copy from test/mjsunit/regress/regress-sqrt.js
copy to test/mjsunit/regress/regress-164442.js
index f2a7e55242cbcdfb281f8e05c465000c98b5a8bc..1160d874f5bc9c73b9f0952627babe59771c1c8f 100644
--- a/test/mjsunit/regress/regress-sqrt.js
+++ b/test/mjsunit/regress/regress-164442.js
@@ -27,21 +27,19 @@
// Flags: --allow-natives-syntax
-// Check that Math.sqrt returns the same value regardless of being
-// optimized or not.
+// Should not take a very long time (n^2 algorithms are bad)
-function f(x) {
- return Math.sqrt(x);
+
+function ensureNotNegative(x) {
+ return Math.max(0, x | 0);
}
-var x = 7.0506280066499245e-233;
-var a = f(x);
+ensureNotNegative(1);
+ensureNotNegative(2);
-f(0.1);
-f(0.2);
-%OptimizeFunctionOnNextCall(f);
+%OptimizeFunctionOnNextCall(ensureNotNegative);
-var b = f(x);
+var r = ensureNotNegative(-1);
-assertEquals(a, b);
+assertEquals(0, r);
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698