summaryrefslogtreecommitdiff
path: root/compiler/optimizing/parallel_move_test.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-12-17 14:28:35 +0000
committerNicolas Geoffray <ngeoffray@google.com>2015-12-17 14:31:05 +0000
commit3e3e4a762c23c3de66436b30e9fc65f35dad344c (patch)
tree8a039c333528790c52a080311511f36186c6ff9f /compiler/optimizing/parallel_move_test.cc
parentfb9f4ad455eced3a07bef1d4772ab1fe34ec133b (diff)
Fix braino in parallel move resolver.
Reiterating over the moves needs to set i to -1, not 0. bug:26241132 Change-Id: Iaae7eac5b421b0ee1b1ce89577c8b951b2d4dae8
Diffstat (limited to 'compiler/optimizing/parallel_move_test.cc')
-rw-r--r--compiler/optimizing/parallel_move_test.cc32
1 files changed, 32 insertions, 0 deletions
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