summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/live_ranges_test.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-11-25 11:18:37 +0000
committerNicolas Geoffray <ngeoffray@google.com>2014-11-25 11:18:37 +0000
commita3c00e54f9b711bf3fc55ce5e7d4f8765e2ea9fa (patch)
treeef28050647d302368a06d7cb3ed18589d5f35e89 /compiler/optimizing/live_ranges_test.cc
parent8acd5cbf7a96e012d28b1773651c4a1bf84b38a3 (diff)
downloadart-a3c00e54f9b711bf3fc55ce5e7d4f8765e2ea9fa.tar.gz
art-a3c00e54f9b711bf3fc55ce5e7d4f8765e2ea9fa.tar.bz2
art-a3c00e54f9b711bf3fc55ce5e7d4f8765e2ea9fa.zip
Fix tests now that dead phis are removed when building SSA.
Change-Id: Ie795f5f1c7c44ec1a3ea2bac822b6255bfb8d45c
Diffstat (limited to 'compiler/optimizing/live_ranges_test.cc')
-rw-r--r--compiler/optimizing/live_ranges_test.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/optimizing/live_ranges_test.cc b/compiler/optimizing/live_ranges_test.cc
index 89c949563b..e3c6fec23b 100644
--- a/compiler/optimizing/live_ranges_test.cc
+++ b/compiler/optimizing/live_ranges_test.cc
@@ -386,7 +386,7 @@ TEST(LiveRangesTest, CFG4) {
Instruction::ADD_INT, 1 << 8,
Instruction::GOTO | 0x300,
Instruction::ADD_INT, 1 << 8,
- Instruction::RETURN | 1 << 8);
+ Instruction::RETURN);
ArenaPool pool;
ArenaAllocator allocator(&pool);
@@ -410,7 +410,10 @@ TEST(LiveRangesTest, CFG4) {
interval = liveness.GetInstructionFromSsaIndex(1)->GetLiveInterval();
range = interval->GetFirstRange();
ASSERT_EQ(4u, range->GetStart());
- ASSERT_EQ(28u, range->GetEnd());
+ ASSERT_EQ(17u, range->GetEnd());
+ range = range->GetNext();
+ ASSERT_EQ(20u, range->GetStart());
+ ASSERT_EQ(23u, range->GetEnd());
ASSERT_TRUE(range->GetNext() == nullptr);
// Test for the first add.
@@ -429,9 +432,8 @@ TEST(LiveRangesTest, CFG4) {
ASSERT_EQ(26u, range->GetEnd());
ASSERT_TRUE(range->GetNext() == nullptr);
- // Test for the phi, which is unused.
HPhi* phi = liveness.GetInstructionFromSsaIndex(4)->AsPhi();
- ASSERT_EQ(phi->NumberOfUses(), 0u);
+ ASSERT_EQ(phi->NumberOfUses(), 1u);
interval = phi->GetLiveInterval();
range = interval->GetFirstRange();
ASSERT_EQ(26u, range->GetStart());