diff options
author | 2015-06-01 18:12:38 +0100 | |
---|---|---|
committer | 2015-06-01 18:12:38 +0100 | |
commit | 23a8188a8deb715d4b9f88b7644474182ae5bedd (patch) | |
tree | 34b4d68d3264658dbc37ef5a57a37005c3f99954 /compiler/optimizing | |
parent | 45fc7d43e614491a3c436838588b19e4b94e4ccd (diff) |
Fix gtest by adding fake lifetime positions.
Change-Id: I7cd89143103ac3e372406dff5d3837c9d91bb00d
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/register_allocator_test.cc | 7 | ||||
-rw-r--r-- | compiler/optimizing/ssa_liveness_analysis.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/compiler/optimizing/register_allocator_test.cc b/compiler/optimizing/register_allocator_test.cc index d07a14a3e6..67525e6755 100644 --- a/compiler/optimizing/register_allocator_test.cc +++ b/compiler/optimizing/register_allocator_test.cc @@ -426,6 +426,13 @@ TEST(RegisterAllocatorTest, FreeUntil) { // Add an artifical range to cover the temps that will be put in the unhandled list. LiveInterval* unhandled = graph->GetEntryBlock()->GetFirstInstruction()->GetLiveInterval(); unhandled->AddLoopRange(0, 60); + + // Populate the instructions in the liveness object, to please the register allocator. + for (size_t i = 0; i < 60; ++i) { + liveness.instructions_from_lifetime_position_.Add( + graph->GetEntryBlock()->GetFirstInstruction()); + } + // For SSA value intervals, only an interval resulted from a split may intersect // with inactive intervals. unhandled = register_allocator.Split(unhandled, 5); diff --git a/compiler/optimizing/ssa_liveness_analysis.h b/compiler/optimizing/ssa_liveness_analysis.h index 4cbe29ae42..4667825a62 100644 --- a/compiler/optimizing/ssa_liveness_analysis.h +++ b/compiler/optimizing/ssa_liveness_analysis.h @@ -1219,6 +1219,7 @@ class SsaLivenessAnalysis : public ValueObject { size_t number_of_ssa_values_; ART_FRIEND_TEST(RegisterAllocatorTest, SpillInactive); + ART_FRIEND_TEST(RegisterAllocatorTest, FreeUntil); DISALLOW_COPY_AND_ASSIGN(SsaLivenessAnalysis); }; |