| Index: src/compiler/machine-operator-reducer-unittest.cc
|
| diff --git a/src/compiler/machine-operator-reducer-unittest.cc b/src/compiler/machine-operator-reducer-unittest.cc
|
| index 6b27b12670432e4f9a75ae358166d7a3637d4ab7..f8849fe7a469f4cb97ecfd768f6caeca46403c39 100644
|
| --- a/src/compiler/machine-operator-reducer-unittest.cc
|
| +++ b/src/compiler/machine-operator-reducer-unittest.cc
|
| @@ -315,6 +315,31 @@ TEST_F(MachineOperatorReducerTest, ChangeUint32ToUint64WithConstant) {
|
|
|
|
|
| // -----------------------------------------------------------------------------
|
| +// TruncateFloat64ToFloat32
|
| +
|
| +
|
| +TEST_F(MachineOperatorReducerTest,
|
| + TruncateFloat64ToFloat32WithChangeFloat32ToFloat64) {
|
| + Node* value = Parameter(0);
|
| + Reduction reduction = Reduce(graph()->NewNode(
|
| + machine()->TruncateFloat64ToFloat32(),
|
| + graph()->NewNode(machine()->ChangeFloat32ToFloat64(), value)));
|
| + ASSERT_TRUE(reduction.Changed());
|
| + EXPECT_EQ(value, reduction.replacement());
|
| +}
|
| +
|
| +
|
| +TEST_F(MachineOperatorReducerTest, TruncateFloat64ToFloat32WithConstant) {
|
| + TRACED_FOREACH(double, x, kFloat64Values) {
|
| + Reduction reduction = Reduce(graph()->NewNode(
|
| + machine()->TruncateFloat64ToFloat32(), Float64Constant(x)));
|
| + ASSERT_TRUE(reduction.Changed());
|
| + EXPECT_THAT(reduction.replacement(), IsFloat32Constant(DoubleToFloat32(x)));
|
| + }
|
| +}
|
| +
|
| +
|
| +// -----------------------------------------------------------------------------
|
| // TruncateFloat64ToInt32
|
|
|
|
|
|
|