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 |