From 3e3e4a762c23c3de66436b30e9fc65f35dad344c Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 17 Dec 2015 14:28:35 +0000 Subject: Fix braino in parallel move resolver. Reiterating over the moves needs to set i to -1, not 0. bug:26241132 Change-Id: Iaae7eac5b421b0ee1b1ce89577c8b951b2d4dae8 --- compiler/optimizing/parallel_move_test.cc | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'compiler/optimizing/parallel_move_test.cc') diff --git a/compiler/optimizing/parallel_move_test.cc b/compiler/optimizing/parallel_move_test.cc index 46e6f3e5d0..5e8fe37669 100644 --- a/compiler/optimizing/parallel_move_test.cc +++ b/compiler/optimizing/parallel_move_test.cc @@ -609,4 +609,36 @@ TYPED_TEST(ParallelMoveTest, CyclesWith64BitsMoves) { } } +TYPED_TEST(ParallelMoveTest, CyclesWith64BitsMoves2) { + ArenaPool pool; + ArenaAllocator allocator(&pool); + + { + TypeParam resolver(&allocator); + HParallelMove* moves = new (&allocator) HParallelMove(&allocator); + moves->AddMove( + Location::RegisterLocation(0), + Location::RegisterLocation(3), + Primitive::kPrimInt, + nullptr); + moves->AddMove( + Location::RegisterPairLocation(2, 3), + Location::RegisterPairLocation(0, 1), + Primitive::kPrimLong, + nullptr); + moves->AddMove( + Location::RegisterLocation(7), + Location::RegisterLocation(2), + Primitive::kPrimInt, + nullptr); + resolver.EmitNativeCode(moves); + if (TestFixture::has_swap) { + ASSERT_STREQ("(2,3 <-> 0,1) (2 -> 3) (7 -> 2)", resolver.GetMessage().c_str()); + } else { + ASSERT_STREQ("(2,3 -> T0,T1) (0 -> 3) (T0,T1 -> 0,1) (7 -> 2)", + resolver.GetMessage().c_str()); + } + } +} + } // namespace art -- cgit v1.2.3-59-g8ed1b