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

Unified Diff: test/unittests/compiler/int64-lowering-unittest.cc

Issue 1844553002: [wasm] New attempt to implement the Int64Lowering of phis. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed out-of-bounds memory access. Created 4 years, 9 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 | « test/unittests/compiler/graph-unittest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/int64-lowering-unittest.cc
diff --git a/test/unittests/compiler/int64-lowering-unittest.cc b/test/unittests/compiler/int64-lowering-unittest.cc
index 05d38400515e70a57cda20afe54a6230878c73e4..a9736b779454e6cc724430bdd7891cd5c52c6612 100644
--- a/test/unittests/compiler/int64-lowering-unittest.cc
+++ b/test/unittests/compiler/int64-lowering-unittest.cc
@@ -642,6 +642,48 @@ TEST_F(Int64LoweringTest, I64Popcnt) {
IsWord32Popcnt(IsInt32Constant(high_word_value(0)))),
IsInt32Constant(0), start(), start()));
}
+
+TEST_F(Int64LoweringTest, I64PhiWord64) {
+ LowerGraph(graph()->NewNode(common()->Phi(MachineRepresentation::kWord64, 2),
+ Int64Constant(value(0)), Int64Constant(value(1)),
+ start()),
+ MachineRepresentation::kWord64);
+
+ EXPECT_THAT(graph()->end()->InputAt(1),
+ IsReturn2(IsPhi(MachineRepresentation::kWord32,
+ IsInt32Constant(low_word_value(0)),
+ IsInt32Constant(low_word_value(1)), start()),
+ IsPhi(MachineRepresentation::kWord32,
+ IsInt32Constant(high_word_value(0)),
+ IsInt32Constant(high_word_value(1)), start()),
+ start(), start()));
+}
+
+void TestPhi(Int64LoweringTest* test, MachineRepresentation rep, Node* v1,
+ Node* v2) {
+ test->LowerGraph(test->graph()->NewNode(test->common()->Phi(rep, 2), v1, v2,
+ test->start()),
+ rep);
+
+ EXPECT_THAT(test->graph()->end()->InputAt(1),
+ IsReturn(IsPhi(rep, v1, v2, test->start()), test->start(),
+ test->start()));
+}
+
+TEST_F(Int64LoweringTest, I64PhiFloat32) {
+ TestPhi(this, MachineRepresentation::kFloat32, Float32Constant(1.5),
+ Float32Constant(2.5));
+}
+
+TEST_F(Int64LoweringTest, I64PhiFloat64) {
+ TestPhi(this, MachineRepresentation::kFloat64, Float32Constant(1.5),
+ Float32Constant(2.5));
+}
+
+TEST_F(Int64LoweringTest, I64PhiWord32) {
+ TestPhi(this, MachineRepresentation::kWord32, Float32Constant(1),
+ Float32Constant(2));
+}
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « test/unittests/compiler/graph-unittest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698