Index: test/cctest/compiler/test-node.cc |
diff --git a/test/cctest/compiler/test-node.cc b/test/cctest/compiler/test-node.cc |
index da10d250f92457974403b2955d26cd49abdfd89d..28d807e4a77ff93a1fca990ad38530793974aa6e 100644 |
--- a/test/cctest/compiler/test-node.cc |
+++ b/test/cctest/compiler/test-node.cc |
@@ -338,6 +338,27 @@ TEST(Inputs) { |
} |
+TEST(RemoveInput) { |
+ GraphTester graph; |
+ |
+ Node* n0 = graph.NewNode(&dummy_operator); |
+ Node* n1 = graph.NewNode(&dummy_operator, n0); |
+ Node* n2 = graph.NewNode(&dummy_operator, n0, n1); |
+ |
+ n1->RemoveInput(0); |
+ CHECK_EQ(0, n1->InputCount()); |
+ CHECK_EQ(1, n0->UseCount()); |
+ |
+ n2->RemoveInput(0); |
+ CHECK_EQ(1, n2->InputCount()); |
+ CHECK_EQ(0, n0->UseCount()); |
+ CHECK_EQ(1, n1->UseCount()); |
+ |
+ n2->RemoveInput(0); |
+ CHECK_EQ(0, n2->InputCount()); |
+} |
+ |
+ |
TEST(AppendInputsAndIterator) { |
GraphTester graph; |