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

Unified Diff: test/unittests/compiler/machine-operator-reducer-unittest.cc

Issue 1350223006: binary-operator-reducer: reduce mul+div(shift) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: make test conditional Created 5 years, 1 month 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
Index: test/unittests/compiler/machine-operator-reducer-unittest.cc
diff --git a/test/unittests/compiler/machine-operator-reducer-unittest.cc b/test/unittests/compiler/machine-operator-reducer-unittest.cc
index 7ffdfe5bf08a0e9806b74b014ffb0ded2c62f72e..6f7ed3aca48df98ad15a36510582cb44563a85b6 100644
--- a/test/unittests/compiler/machine-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc
@@ -1646,6 +1646,18 @@ TEST_F(MachineOperatorReducerTest, StoreRepWord16WithWord32SarAndWord32Shl) {
}
}
+
+TEST_F(MachineOperatorReducerTest, RoundPlusTruncate) {
+ Node* p0 = Parameter(0);
+ Node* t0 = graph()->NewNode(machine()->RoundInt64ToFloat64(), p0);
+ Node* t1 = graph()->NewNode(
+ machine()->TruncateFloat64ToInt32(TruncationMode::kJavaScript), t0);
+
+ Reduction r = Reduce(t1);
+ ASSERT_TRUE(r.Changed());
+ EXPECT_THAT(r.replacement(), p0);
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « test/unittests/compiler/binary-operator-reducer-unittest.cc ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698