Chromium Code Reviews| 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 7de6c7d2f24a6beffe37f5a5ffa4ac9f4af6bfc9..ac39e0ca8aa6bda8445587709314fc3875d2431d 100644 |
| --- a/test/unittests/compiler/machine-operator-reducer-unittest.cc |
| +++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc |
| @@ -289,7 +289,6 @@ TEST_F(MachineOperatorReducerTest, |
| EXPECT_EQ(value, reduction.replacement()); |
| } |
| - |
| TEST_F(MachineOperatorReducerTest, ChangeFloat64ToInt32WithConstant) { |
| TRACED_FOREACH(int32_t, x, kInt32Values) { |
| Reduction reduction = Reduce(graph()->NewNode( |
| @@ -1506,6 +1505,27 @@ TEST_F(MachineOperatorReducerTest, Int32MulWithOverflowWithConstant) { |
| } |
| // ----------------------------------------------------------------------------- |
| +// Int32LessThan |
| + |
| +TEST_F(MachineOperatorReducerTest, Int32LessThanWithWord32Or) { |
| + // Node* control = graph()->start(); |
|
Benedikt Meurer
2016/07/20 17:37:44
Nit: Remove this line.
|
| + Node* const p0 = Parameter(0); |
| + TRACED_FOREACH(int32_t, x, kInt32Values) { |
| + Node* word32_or = |
| + graph()->NewNode(machine()->Word32Or(), p0, Int32Constant(x)); |
| + Node* less_than = graph()->NewNode(machine()->Int32LessThan(), word32_or, |
| + Int32Constant(0)); |
| + Reduction r = Reduce(less_than); |
| + if (x < 0) { |
| + ASSERT_TRUE(r.Changed()); |
| + EXPECT_THAT(r.replacement(), IsInt32Constant(1)); |
| + } else { |
| + ASSERT_FALSE(r.Changed()); |
| + } |
| + } |
| +} |
| + |
| +// ----------------------------------------------------------------------------- |
| // Uint32LessThan |
| TEST_F(MachineOperatorReducerTest, Uint32LessThanWithWord32Sar) { |