Index: test/cctest/compiler/test-node.cc |
diff --git a/test/cctest/compiler/test-node.cc b/test/cctest/compiler/test-node.cc |
index 1a6bf7ca129a34cbb72b887584eeda6b87b7d3e0..8ac38274b651e4893a4f8bc27b5f910bf35cc84f 100644 |
--- a/test/cctest/compiler/test-node.cc |
+++ b/test/cctest/compiler/test-node.cc |
@@ -16,8 +16,14 @@ using namespace v8::internal::compiler; |
#define NONE reinterpret_cast<Node*>(1) |
-static Operator dummy_operator(IrOpcode::kParameter, Operator::kNoWrite, |
- "dummy", 0, 0, 0, 1, 0, 0); |
+static Operator dummy_operator0(IrOpcode::kParameter, Operator::kNoWrite, |
+ "dummy", 0, 0, 0, 1, 0, 0); |
+static Operator dummy_operator1(IrOpcode::kParameter, Operator::kNoWrite, |
+ "dummy", 1, 0, 0, 1, 0, 0); |
+static Operator dummy_operator2(IrOpcode::kParameter, Operator::kNoWrite, |
+ "dummy", 2, 0, 0, 1, 0, 0); |
+static Operator dummy_operator3(IrOpcode::kParameter, Operator::kNoWrite, |
+ "dummy", 3, 0, 0, 1, 0, 0); |
#define CHECK_USES(node, ...) \ |
do { \ |
@@ -28,9 +34,12 @@ static Operator dummy_operator(IrOpcode::kParameter, Operator::kNoWrite, |
} while (false) |
+namespace { |
+ |
typedef std::multiset<Node*, std::less<Node*>> NodeMSet; |
-static void CheckUseChain(Node* node, Node** uses, int use_count) { |
+ |
+void CheckUseChain(Node* node, Node** uses, int use_count) { |
// Check ownership. |
if (use_count == 1) CHECK(node->OwnedBy(uses[0])); |
if (use_count > 1) { |
@@ -82,16 +91,7 @@ static void CheckUseChain(Node* node, Node** uses, int use_count) { |
} |
-#define CHECK_INPUTS(node, ...) \ |
- do { \ |
- Node* __array[] = {__VA_ARGS__}; \ |
- int __size = \ |
- __array[0] != NONE ? static_cast<int>(arraysize(__array)) : 0; \ |
- CheckInputs(node, __array, __size); \ |
- } while (false) |
- |
- |
-static void CheckInputs(Node* node, Node** inputs, int input_count) { |
+void CheckInputs(Node* node, Node** inputs, int input_count) { |
CHECK_EQ(input_count, node->InputCount()); |
// Check InputAt(). |
for (int i = 0; i < static_cast<int>(input_count); i++) { |
@@ -129,14 +129,25 @@ static void CheckInputs(Node* node, Node** inputs, int input_count) { |
} |
} |
+} // namespace |
+ |
+ |
+#define CHECK_INPUTS(node, ...) \ |
+ do { \ |
+ Node* __array[] = {__VA_ARGS__}; \ |
+ int __size = \ |
+ __array[0] != NONE ? static_cast<int>(arraysize(__array)) : 0; \ |
+ CheckInputs(node, __array, __size); \ |
+ } while (false) |
+ |
TEST(NodeUseIteratorReplaceUses) { |
Zone zone; |
Graph graph(&zone); |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
- Node* n3 = graph.NewNode(&dummy_operator); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
+ Node* n3 = graph.NewNode(&dummy_operator0); |
CHECK_USES(n0, n1, n2); |
@@ -158,8 +169,8 @@ TEST(NodeUseIteratorReplaceUses) { |
TEST(NodeUseIteratorReplaceUsesSelf) { |
Zone zone; |
Graph graph(&zone); |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
CHECK_USES(n0, n1); |
CHECK_USES(n1, NONE); |
@@ -169,7 +180,7 @@ TEST(NodeUseIteratorReplaceUsesSelf) { |
CHECK_USES(n0, NONE); |
CHECK_USES(n1, n1); |
- Node* n2 = graph.NewNode(&dummy_operator); |
+ Node* n2 = graph.NewNode(&dummy_operator0); |
n1->ReplaceUses(n2); |
@@ -182,11 +193,11 @@ TEST(NodeUseIteratorReplaceUsesSelf) { |
TEST(ReplaceInput) { |
Zone zone; |
Graph graph(&zone); |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator); |
- Node* n3 = graph.NewNode(&dummy_operator, n0, n1, n2); |
- Node* n4 = graph.NewNode(&dummy_operator); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator0); |
+ Node* n3 = graph.NewNode(&dummy_operator3, n0, n1, n2); |
+ Node* n4 = graph.NewNode(&dummy_operator0); |
CHECK_USES(n0, n3); |
CHECK_USES(n1, n3); |
@@ -210,17 +221,17 @@ TEST(OwnedBy) { |
Graph graph(&zone); |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
CHECK(!n0->OwnedBy(n1)); |
CHECK(!n1->OwnedBy(n0)); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
CHECK(n0->OwnedBy(n2)); |
CHECK(!n2->OwnedBy(n0)); |
- Node* n3 = graph.NewNode(&dummy_operator, n0); |
+ Node* n3 = graph.NewNode(&dummy_operator1, n0); |
CHECK(!n0->OwnedBy(n2)); |
CHECK(!n0->OwnedBy(n3)); |
CHECK(!n2->OwnedBy(n0)); |
@@ -228,11 +239,11 @@ TEST(OwnedBy) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
CHECK(n0->OwnedBy(n1)); |
CHECK(!n1->OwnedBy(n0)); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
CHECK(!n0->OwnedBy(n1)); |
CHECK(!n0->OwnedBy(n2)); |
CHECK(!n1->OwnedBy(n0)); |
@@ -240,7 +251,7 @@ TEST(OwnedBy) { |
CHECK(!n2->OwnedBy(n0)); |
CHECK(!n2->OwnedBy(n1)); |
- Node* n3 = graph.NewNode(&dummy_operator); |
+ Node* n3 = graph.NewNode(&dummy_operator0); |
n2->ReplaceInput(0, n3); |
CHECK(n0->OwnedBy(n1)); |
@@ -259,18 +270,18 @@ TEST(Uses) { |
Zone zone; |
Graph graph(&zone); |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
CHECK_USES(n0, n1); |
CHECK_USES(n1, NONE); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
CHECK_USES(n0, n1, n2); |
CHECK_USES(n2, NONE); |
- Node* n3 = graph.NewNode(&dummy_operator, n0); |
+ Node* n3 = graph.NewNode(&dummy_operator1, n0); |
CHECK_USES(n0, n1, n2, n3); |
CHECK_USES(n3, NONE); |
@@ -281,14 +292,14 @@ TEST(Inputs) { |
Zone zone; |
Graph graph(&zone); |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
- Node* n3 = graph.NewNode(&dummy_operator, n0, n1, n2); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
+ Node* n3 = graph.NewNode(&dummy_operator3, n0, n1, n2); |
CHECK_INPUTS(n3, n0, n1, n2); |
- Node* n4 = graph.NewNode(&dummy_operator, n0, n1, n2); |
+ Node* n4 = graph.NewNode(&dummy_operator3, n0, n1, n2); |
n3->AppendInput(graph.zone(), n4); |
CHECK_INPUTS(n3, n0, n1, n2, n4); |
@@ -299,7 +310,7 @@ TEST(Inputs) { |
CHECK_INPUTS(n3, n0, n1, n2, n4, n4); |
CHECK_USES(n4, n3, n3); |
- Node* n5 = graph.NewNode(&dummy_operator, n4); |
+ Node* n5 = graph.NewNode(&dummy_operator1, n4); |
CHECK_USES(n4, n3, n3, n5); |
} |
@@ -309,9 +320,9 @@ TEST(RemoveInput) { |
Zone zone; |
Graph graph(&zone); |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
- Node* n2 = graph.NewNode(&dummy_operator, n0, n1); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
+ Node* n2 = graph.NewNode(&dummy_operator2, n0, n1); |
CHECK_INPUTS(n0, NONE); |
CHECK_INPUTS(n1, n0); |
@@ -339,16 +350,16 @@ TEST(AppendInputsAndIterator) { |
Zone zone; |
Graph graph(&zone); |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
- Node* n2 = graph.NewNode(&dummy_operator, n0, n1); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
+ Node* n2 = graph.NewNode(&dummy_operator2, n0, n1); |
CHECK_INPUTS(n0, NONE); |
CHECK_INPUTS(n1, n0); |
CHECK_INPUTS(n2, n0, n1); |
CHECK_USES(n0, n1, n2); |
- Node* n3 = graph.NewNode(&dummy_operator); |
+ Node* n3 = graph.NewNode(&dummy_operator0); |
n2->AppendInput(graph.zone(), n3); |
@@ -361,9 +372,9 @@ TEST(NullInputsSimple) { |
Zone zone; |
Graph graph(&zone); |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
- Node* n2 = graph.NewNode(&dummy_operator, n0, n1); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
+ Node* n2 = graph.NewNode(&dummy_operator2, n0, n1); |
CHECK_INPUTS(n0, NONE); |
CHECK_INPUTS(n1, n0); |
@@ -388,10 +399,10 @@ TEST(NullInputsAppended) { |
Zone zone; |
Graph graph(&zone); |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
- Node* n3 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
+ Node* n3 = graph.NewNode(&dummy_operator1, n0); |
n3->AppendInput(graph.zone(), n1); |
n3->AppendInput(graph.zone(), n2); |
@@ -411,10 +422,10 @@ TEST(ReplaceUsesFromAppendedInputs) { |
Zone zone; |
Graph graph(&zone); |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
- Node* n3 = graph.NewNode(&dummy_operator); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
+ Node* n3 = graph.NewNode(&dummy_operator0); |
CHECK_INPUTS(n2, n0); |
@@ -439,14 +450,14 @@ TEST(ReplaceInputMultipleUses) { |
Zone zone; |
Graph graph(&zone); |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
n2->ReplaceInput(0, n1); |
CHECK_EQ(0, n0->UseCount()); |
CHECK_EQ(1, n1->UseCount()); |
- Node* n3 = graph.NewNode(&dummy_operator, n0); |
+ Node* n3 = graph.NewNode(&dummy_operator1, n0); |
n3->ReplaceInput(0, n1); |
CHECK_EQ(0, n0->UseCount()); |
CHECK_EQ(2, n1->UseCount()); |
@@ -458,25 +469,25 @@ TEST(TrimInputCountInline) { |
Graph graph(&zone); |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
n1->TrimInputCount(1); |
CHECK_INPUTS(n1, n0); |
CHECK_USES(n0, n1); |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
n1->TrimInputCount(0); |
CHECK_INPUTS(n1, NONE); |
CHECK_USES(n0, NONE); |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator, n0, n1); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator2, n0, n1); |
n2->TrimInputCount(2); |
CHECK_INPUTS(n2, n0, n1); |
CHECK_USES(n0, n2); |
@@ -484,9 +495,9 @@ TEST(TrimInputCountInline) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator, n0, n1); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator2, n0, n1); |
n2->TrimInputCount(1); |
CHECK_INPUTS(n2, n0); |
CHECK_USES(n0, n2); |
@@ -494,9 +505,9 @@ TEST(TrimInputCountInline) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator, n0, n1); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator2, n0, n1); |
n2->TrimInputCount(0); |
CHECK_INPUTS(n2, NONE); |
CHECK_USES(n0, NONE); |
@@ -504,16 +515,16 @@ TEST(TrimInputCountInline) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator, n0, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator2, n0, n0); |
n2->TrimInputCount(1); |
CHECK_INPUTS(n2, n0); |
CHECK_USES(n0, n2); |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator, n0, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator2, n0, n0); |
n2->TrimInputCount(0); |
CHECK_INPUTS(n2, NONE); |
CHECK_USES(n0, NONE); |
@@ -526,8 +537,8 @@ TEST(TrimInputCountOutOfLine1) { |
Graph graph(&zone); |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
n1->AppendInput(graph.zone(), n0); |
CHECK_INPUTS(n1, n0); |
CHECK_USES(n0, n1); |
@@ -538,8 +549,8 @@ TEST(TrimInputCountOutOfLine1) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
n1->AppendInput(graph.zone(), n0); |
CHECK_EQ(1, n1->InputCount()); |
n1->TrimInputCount(0); |
@@ -548,9 +559,9 @@ TEST(TrimInputCountOutOfLine1) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator0); |
n2->AppendInput(graph.zone(), n0); |
n2->AppendInput(graph.zone(), n1); |
CHECK_INPUTS(n2, n0, n1); |
@@ -562,9 +573,9 @@ TEST(TrimInputCountOutOfLine1) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator0); |
n2->AppendInput(graph.zone(), n0); |
n2->AppendInput(graph.zone(), n1); |
CHECK_INPUTS(n2, n0, n1); |
@@ -576,9 +587,9 @@ TEST(TrimInputCountOutOfLine1) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator0); |
n2->AppendInput(graph.zone(), n0); |
n2->AppendInput(graph.zone(), n1); |
CHECK_INPUTS(n2, n0, n1); |
@@ -590,8 +601,8 @@ TEST(TrimInputCountOutOfLine1) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator0); |
n2->AppendInput(graph.zone(), n0); |
n2->AppendInput(graph.zone(), n0); |
CHECK_INPUTS(n2, n0, n0); |
@@ -602,8 +613,8 @@ TEST(TrimInputCountOutOfLine1) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator0); |
n2->AppendInput(graph.zone(), n0); |
n2->AppendInput(graph.zone(), n0); |
CHECK_INPUTS(n2, n0, n0); |
@@ -620,9 +631,9 @@ TEST(TrimInputCountOutOfLine2) { |
Graph graph(&zone); |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
n2->AppendInput(graph.zone(), n1); |
CHECK_INPUTS(n2, n0, n1); |
n2->TrimInputCount(2); |
@@ -633,9 +644,9 @@ TEST(TrimInputCountOutOfLine2) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
n2->AppendInput(graph.zone(), n1); |
CHECK_INPUTS(n2, n0, n1); |
n2->TrimInputCount(1); |
@@ -646,9 +657,9 @@ TEST(TrimInputCountOutOfLine2) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
n2->AppendInput(graph.zone(), n1); |
CHECK_INPUTS(n2, n0, n1); |
n2->TrimInputCount(0); |
@@ -659,8 +670,8 @@ TEST(TrimInputCountOutOfLine2) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
n2->AppendInput(graph.zone(), n0); |
CHECK_INPUTS(n2, n0, n0); |
CHECK_USES(n0, n2, n2); |
@@ -671,8 +682,8 @@ TEST(TrimInputCountOutOfLine2) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n2 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n2 = graph.NewNode(&dummy_operator1, n0); |
n2->AppendInput(graph.zone(), n0); |
CHECK_EQ(2, n2->InputCount()); |
CHECK_EQ(2, n0->UseCount()); |
@@ -689,14 +700,14 @@ TEST(NullAllInputs) { |
Graph graph(&zone); |
for (int i = 0; i < 2; i++) { |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
Node* n2; |
if (i == 0) { |
- n2 = graph.NewNode(&dummy_operator, n0, n1); |
+ n2 = graph.NewNode(&dummy_operator2, n0, n1); |
CHECK_INPUTS(n2, n0, n1); |
} else { |
- n2 = graph.NewNode(&dummy_operator, n0); |
+ n2 = graph.NewNode(&dummy_operator1, n0); |
CHECK_INPUTS(n2, n0); |
n2->AppendInput(graph.zone(), n1); // with out-of-line input. |
CHECK_INPUTS(n2, n0, n1); |
@@ -718,8 +729,8 @@ TEST(NullAllInputs) { |
} |
{ |
- Node* n0 = graph.NewNode(&dummy_operator); |
- Node* n1 = graph.NewNode(&dummy_operator, n0); |
+ Node* n0 = graph.NewNode(&dummy_operator0); |
+ Node* n1 = graph.NewNode(&dummy_operator1, n0); |
n1->ReplaceInput(0, n1); // self-reference. |
CHECK_INPUTS(n0, NONE); |
@@ -741,13 +752,13 @@ TEST(AppendAndTrim) { |
Graph graph(&zone); |
Node* nodes[] = { |
- graph.NewNode(&dummy_operator), graph.NewNode(&dummy_operator), |
- graph.NewNode(&dummy_operator), graph.NewNode(&dummy_operator), |
- graph.NewNode(&dummy_operator)}; |
+ graph.NewNode(&dummy_operator0), graph.NewNode(&dummy_operator0), |
+ graph.NewNode(&dummy_operator0), graph.NewNode(&dummy_operator0), |
+ graph.NewNode(&dummy_operator0)}; |
int max = static_cast<int>(arraysize(nodes)); |
- Node* last = graph.NewNode(&dummy_operator); |
+ Node* last = graph.NewNode(&dummy_operator0); |
for (int i = 0; i < max; i++) { |
last->AppendInput(graph.zone(), nodes[i]); |