diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-29 09:46:03 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-29 09:46:42 +0100 |
commit | fd680d8c8b3ab7cf162bae2d322f6327d05ef23f (patch) | |
tree | 16415bde6d075b7dee49cec908e7c7c1971a18e7 /compiler/optimizing | |
parent | eb1d22bf405f0edaeb34f78905d75f167e88b868 (diff) | |
download | art-fd680d8c8b3ab7cf162bae2d322f6327d05ef23f.zip art-fd680d8c8b3ab7cf162bae2d322f6327d05ef23f.tar.gz art-fd680d8c8b3ab7cf162bae2d322f6327d05ef23f.tar.bz2 |
Fix test now that instructions can die at instruction entry.
Change-Id: I816279c55d12de8e69ac0b6c88730bd676c03335
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/register_allocator_test.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/optimizing/register_allocator_test.cc b/compiler/optimizing/register_allocator_test.cc index 3e3b6b1..535a768 100644 --- a/compiler/optimizing/register_allocator_test.cc +++ b/compiler/optimizing/register_allocator_test.cc @@ -339,7 +339,7 @@ TEST(RegisterAllocatorTest, FirstRegisterUse) { HAdd* last_add = graph->GetBlocks().Get(1)->GetLastInstruction()->GetPrevious()->AsAdd(); ASSERT_EQ(last_add->InputAt(0), first_add); LiveInterval* interval = first_add->GetLiveInterval(); - ASSERT_EQ(interval->GetEnd(), last_add->GetLifetimePosition() + 1); + ASSERT_EQ(interval->GetEnd(), last_add->GetLifetimePosition()); ASSERT_TRUE(interval->GetNextSibling() == nullptr); // We need a register for the output of the instruction. @@ -348,14 +348,14 @@ TEST(RegisterAllocatorTest, FirstRegisterUse) { // Split at the next instruction. interval = interval->SplitAt(first_add->GetLifetimePosition() + 2); // The user of the split is the last add. - ASSERT_EQ(interval->FirstRegisterUse(), last_add->GetLifetimePosition() + 1); + ASSERT_EQ(interval->FirstRegisterUse(), last_add->GetLifetimePosition() - 1); // Split before the last add. LiveInterval* new_interval = interval->SplitAt(last_add->GetLifetimePosition() - 1); // Ensure the current interval has no register use... ASSERT_EQ(interval->FirstRegisterUse(), kNoLifetime); // And the new interval has it for the last add. - ASSERT_EQ(new_interval->FirstRegisterUse(), last_add->GetLifetimePosition() + 1); + ASSERT_EQ(new_interval->FirstRegisterUse(), last_add->GetLifetimePosition() - 1); } TEST(RegisterAllocatorTest, DeadPhi) { |