From c08fb725b561ead05dc120f2e92ea5228d14eec0 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 15 Aug 2024 07:40:38 +0000 Subject: 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 --- compiler/optimizing/nodes_test.cc | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'compiler/optimizing/nodes_test.cc') 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()); -- cgit v1.2.3-59-g8ed1b