diff options
author | 2015-04-16 08:00:07 +0000 | |
---|---|---|
committer | 2015-04-16 08:00:08 +0000 | |
commit | ee2da343bb2a54d9d77e29226e0317ccc913c8c1 (patch) | |
tree | 1bac4253382eb605c3904f3bc00807dd85e15424 /compiler/optimizing/dominator_test.cc | |
parent | 8e8bb8aab6f19ccb5b5869a632d9bc882891e17e (diff) | |
parent | f776b92a0d52bb522043812dacb9c21ac11858e2 (diff) |
Merge "Remove dead blocks for the blocks_ array."
Diffstat (limited to 'compiler/optimizing/dominator_test.cc')
-rw-r--r-- | compiler/optimizing/dominator_test.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/optimizing/dominator_test.cc b/compiler/optimizing/dominator_test.cc index 7623e421fd..61a7697301 100644 --- a/compiler/optimizing/dominator_test.cc +++ b/compiler/optimizing/dominator_test.cc @@ -36,7 +36,13 @@ static void TestCode(const uint16_t* data, const int* blocks, size_t blocks_leng ASSERT_EQ(graph->GetBlocks().Size(), blocks_length); for (size_t i = 0, e = blocks_length; i < e; ++i) { if (blocks[i] == -1) { - ASSERT_EQ(nullptr, graph->GetBlocks().Get(i)->GetDominator()); + if (graph->GetBlocks().Get(i) == nullptr) { + // Dead block. + } else { + // Only the entry block has no dominator. + ASSERT_EQ(nullptr, graph->GetBlocks().Get(i)->GetDominator()); + ASSERT_TRUE(graph->GetBlocks().Get(i)->IsEntryBlock()); + } } else { ASSERT_NE(nullptr, graph->GetBlocks().Get(i)->GetDominator()); ASSERT_EQ(blocks[i], graph->GetBlocks().Get(i)->GetDominator()->GetBlockId()); |