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 ffc0d5e661c068c4beb7aa3fe8d1f5724b0577d9..a62216dfcdf283e512f215909895c490abf9eb8e 100644 |
--- a/test/unittests/compiler/machine-operator-reducer-unittest.cc |
+++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc |
@@ -455,6 +455,20 @@ TEST_F(MachineOperatorReducerTest, TruncateFloat64ToInt32WithConstant) { |
} |
+TEST_F(MachineOperatorReducerTest, TruncateFloat64ToInt32WithPhi) { |
+ Node* const p0 = Parameter(0); |
+ Node* const p1 = Parameter(1); |
+ Node* const merge = graph()->start(); |
+ Reduction reduction = Reduce(graph()->NewNode( |
+ machine()->TruncateFloat64ToInt32(), |
+ graph()->NewNode(common()->Phi(kMachFloat64, 2), p0, p1, merge))); |
+ ASSERT_TRUE(reduction.Changed()); |
+ EXPECT_THAT(reduction.replacement(), |
+ IsPhi(kMachInt32, IsTruncateFloat64ToInt32(p0), |
+ IsTruncateFloat64ToInt32(p1), merge)); |
+} |
+ |
+ |
// ----------------------------------------------------------------------------- |
// TruncateInt64ToInt32 |