diff options
author | 2024-08-15 07:40:38 +0000 | |
---|---|---|
committer | 2024-08-21 09:12:50 +0000 | |
commit | c08fb725b561ead05dc120f2e92ea5228d14eec0 (patch) | |
tree | c306cd68d8f26a33b3c45e2f07db695dccc00e6e /compiler/optimizing/nodes_test.cc | |
parent | 1ea8807afeea6cd48127449cbd10458cc32cf4ce (diff) |
Change `MakeCondition()` to take `IfCondition`...
... instead of the instruction type argument.
And continue with loop construction cleanup in gtests.
Test: m test-art-host-gtest
Change-Id: I8cb83ae0c6d3cdb2a2ee4da0608cfeb69df722eb
Diffstat (limited to 'compiler/optimizing/nodes_test.cc')
-rw-r--r-- | compiler/optimizing/nodes_test.cc | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/compiler/optimizing/nodes_test.cc b/compiler/optimizing/nodes_test.cc index ce4ad848dd..01e12a061f 100644 --- a/compiler/optimizing/nodes_test.cc +++ b/compiler/optimizing/nodes_test.cc @@ -143,26 +143,14 @@ TEST_F(NodeTest, ClearDominanceThenLoopInformation) { * and environment lists. */ TEST_F(NodeTest, RemoveInstruction) { - HGraph* graph = CreateGraph(); - HBasicBlock* entry = new (GetAllocator()) HBasicBlock(graph); - graph->AddBlock(entry); - graph->SetEntryBlock(entry); - HInstruction* parameter = MakeParam(DataType::Type::kReference); - MakeGoto(entry); + HBasicBlock* main = InitEntryMainExitGraphWithReturnVoid(); - HBasicBlock* first_block = new (GetAllocator()) HBasicBlock(graph); - graph->AddBlock(first_block); - entry->AddSuccessor(first_block); - HInstruction* null_check = MakeNullCheck(first_block, parameter); - MakeReturnVoid(first_block); + HInstruction* parameter = MakeParam(DataType::Type::kReference); - HBasicBlock* exit_block = new (GetAllocator()) HBasicBlock(graph); - graph->AddBlock(exit_block); - first_block->AddSuccessor(exit_block); - MakeExit(exit_block); + HInstruction* null_check = MakeNullCheck(main, parameter); HEnvironment* environment = new (GetAllocator()) HEnvironment( - GetAllocator(), 1, graph->GetArtMethod(), 0, null_check); + GetAllocator(), 1, graph_->GetArtMethod(), 0, null_check); null_check->SetRawEnvironment(environment); environment->SetRawEnvAt(0, parameter); parameter->AddEnvUseAt(null_check->GetEnvironment(), 0); @@ -170,7 +158,7 @@ TEST_F(NodeTest, RemoveInstruction) { ASSERT_TRUE(parameter->HasEnvironmentUses()); ASSERT_TRUE(parameter->HasUses()); - first_block->RemoveInstruction(null_check); + main->RemoveInstruction(null_check); ASSERT_FALSE(parameter->HasEnvironmentUses()); ASSERT_FALSE(parameter->HasUses()); |