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

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

Issue 2243803002: [turbofan] Fix CheckedInt32Mod lowering for -0 case with negative left hand side. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/compiler/effect-control-linearizer.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-5286.js
diff --git a/test/mjsunit/regress/regress-5286.js b/test/mjsunit/regress/regress-5286.js
new file mode 100644
index 0000000000000000000000000000000000000000..210d986a66fcc491c41f4c597f7623d13c0aac7d
--- /dev/null
+++ b/test/mjsunit/regress/regress-5286.js
@@ -0,0 +1,41 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+(function() {
+ function foo(x, y) { return x % y; }
+
+ assertEquals(0, foo(2, 2));
+ assertEquals(0, foo(4, 4));
+ %OptimizeFunctionOnNextCall(foo);
+ assertEquals(-0, foo(-8, 8));
+})();
+
+(function() {
+ function foo(x, y) { return x % y; }
+
+ assertEquals(0, foo(1, 1));
+ assertEquals(0, foo(2, 2));
+ %OptimizeFunctionOnNextCall(foo);
+ assertEquals(-0, foo(-3, 3));
+})();
+
+(function() {
+ function foo(x, y) { return x % y; }
+
+ assertEquals(0, foo(1, 1));
+ assertEquals(0, foo(2, 2));
+ %OptimizeFunctionOnNextCall(foo);
+ assertEquals(-0, foo(-2147483648, -1));
+})();
+
+(function() {
+ function foo(x, y) { return x % y; }
+
+ assertEquals(0, foo(1, 1));
+ assertEquals(0, foo(2, 2));
+ %OptimizeFunctionOnNextCall(foo);
+ assertEquals(-0, foo(-2147483648, -2147483648));
+})();
« no previous file with comments | « src/compiler/effect-control-linearizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698