Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Unified Diff: test/cctest/compiler/test-node.cc

Issue 2172223002: [stubs] Call interface descriptors cleanup. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@store-ic-tf
Patch Set: Addressing comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | test/unittests/interpreter/interpreter-assembler-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-node.cc
diff --git a/test/cctest/compiler/test-node.cc b/test/cctest/compiler/test-node.cc
index d317c3877c82866356317581af2ceb1914ffed2c..e2aacf3100766bc4ab4504a780fd84b6b8142706 100644
--- a/test/cctest/compiler/test-node.cc
+++ b/test/cctest/compiler/test-node.cc
@@ -320,6 +320,80 @@ TEST(Inputs) {
CHECK_USES(n4, n3, n3, n5);
}
+TEST(InsertInputs) {
+ base::AccountingAllocator allocator;
+ Zone zone(&allocator);
+ Graph graph(&zone);
+
+ Node* n0 = graph.NewNode(&dummy_operator0);
+ Node* n1 = graph.NewNode(&dummy_operator1, n0);
+ Node* n2 = graph.NewNode(&dummy_operator1, n0);
+
+ {
+ Node* node = graph.NewNode(&dummy_operator1, n0);
+ node->InsertInputs(graph.zone(), 0, 1);
+ node->ReplaceInput(0, n1);
+ CHECK_INPUTS(node, n1, n0);
+ }
+ {
+ Node* node = graph.NewNode(&dummy_operator1, n0);
+ node->InsertInputs(graph.zone(), 0, 2);
+ node->ReplaceInput(0, node);
+ node->ReplaceInput(1, n2);
+ CHECK_INPUTS(node, node, n2, n0);
+ }
+ {
+ Node* node = graph.NewNode(&dummy_operator3, n0, n1, n2);
+ node->InsertInputs(graph.zone(), 0, 1);
+ node->ReplaceInput(0, node);
+ CHECK_INPUTS(node, node, n0, n1, n2);
+ }
+ {
+ Node* node = graph.NewNode(&dummy_operator3, n0, n1, n2);
+ node->InsertInputs(graph.zone(), 1, 1);
+ node->ReplaceInput(1, node);
+ CHECK_INPUTS(node, n0, node, n1, n2);
+ }
+ {
+ Node* node = graph.NewNode(&dummy_operator3, n0, n1, n2);
+ node->InsertInputs(graph.zone(), 2, 1);
+ node->ReplaceInput(2, node);
+ CHECK_INPUTS(node, n0, n1, node, n2);
+ }
+ {
+ Node* node = graph.NewNode(&dummy_operator3, n0, n1, n2);
+ node->InsertInputs(graph.zone(), 2, 1);
+ node->ReplaceInput(2, node);
+ CHECK_INPUTS(node, n0, n1, node, n2);
+ }
+ {
+ Node* node = graph.NewNode(&dummy_operator3, n0, n1, n2);
+ node->InsertInputs(graph.zone(), 0, 4);
+ node->ReplaceInput(0, node);
+ node->ReplaceInput(1, node);
+ node->ReplaceInput(2, node);
+ node->ReplaceInput(3, node);
+ CHECK_INPUTS(node, node, node, node, node, n0, n1, n2);
+ }
+ {
+ Node* node = graph.NewNode(&dummy_operator3, n0, n1, n2);
+ node->InsertInputs(graph.zone(), 1, 4);
+ node->ReplaceInput(1, node);
+ node->ReplaceInput(2, node);
+ node->ReplaceInput(3, node);
+ node->ReplaceInput(4, node);
+ CHECK_INPUTS(node, n0, node, node, node, node, n1, n2);
+ }
+ {
+ Node* node = graph.NewNode(&dummy_operator3, n0, n1, n2);
+ node->InsertInputs(graph.zone(), 2, 4);
+ node->ReplaceInput(2, node);
+ node->ReplaceInput(3, node);
+ node->ReplaceInput(4, node);
+ node->ReplaceInput(5, node);
+ CHECK_INPUTS(node, n0, n1, node, node, node, node, n2);
+ }
+}
TEST(RemoveInput) {
base::AccountingAllocator allocator;
« no previous file with comments | « src/runtime/runtime.h ('k') | test/unittests/interpreter/interpreter-assembler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698