Index: src/compiler/graph-reducer-unittest.cc |
diff --git a/src/compiler/graph-reducer-unittest.cc b/src/compiler/graph-reducer-unittest.cc |
index 9dbc9ea2ad590068716d10355c00c074224b61f5..6567203e88def1ebb64a3bd1e0ff1f4dd14b4d9f 100644 |
--- a/src/compiler/graph-reducer-unittest.cc |
+++ b/src/compiler/graph-reducer-unittest.cc |
@@ -20,7 +20,8 @@ namespace compiler { |
namespace { |
-SimpleOperator OP0(0, Operator::kNoWrite, 0, 0, "op0"); |
+SimpleOperator OP0(0, Operator::kNoWrite, 0, 1, "op0"); |
+SimpleOperator OP1(1, Operator::kNoProperties, 1, 1, "op1"); |
struct MockReducer : public Reducer { |
@@ -73,6 +74,19 @@ class GraphReducerTest : public TestWithZone { |
}; |
+TEST_F(GraphReducerTest, NodeIsDeadAfterReplace) { |
+ StrictMock<MockReducer> r; |
+ Node* node0 = graph()->NewNode(&OP0); |
+ Node* node1 = graph()->NewNode(&OP1, node0); |
+ Node* node2 = graph()->NewNode(&OP1, node0); |
+ EXPECT_CALL(r, Reduce(node1)).WillOnce(Return(Reducer::Replace(node2))); |
+ ReduceNode(node1, &r); |
+ EXPECT_FALSE(node0->IsDead()); |
+ EXPECT_TRUE(node1->IsDead()); |
+ EXPECT_FALSE(node2->IsDead()); |
+} |
+ |
+ |
TEST_F(GraphReducerTest, ReduceOnceForEveryReducer) { |
StrictMock<MockReducer> r1, r2; |
Node* node0 = graph()->NewNode(&OP0); |
@@ -95,17 +109,6 @@ TEST_F(GraphReducerTest, ReduceAgainAfterChanged) { |
ReduceNode(node0, &r1, &r2, &r3); |
} |
- |
-TEST_F(GraphReducerTest, OperatorIsNullAfterReplace) { |
- StrictMock<MockReducer> r; |
- Node* node0 = graph()->NewNode(&OP0); |
- Node* node1 = graph()->NewNode(&OP0); |
- EXPECT_CALL(r, Reduce(node0)).WillOnce(Return(Reducer::Replace(node1))); |
- ReduceNode(node0, &r); |
- EXPECT_EQ(NULL, node0->op()); |
- EXPECT_EQ(&OP0, node1->op()); |
-} |
- |
} // namespace compiler |
} // namespace internal |
} // namespace v8 |