Index: test/unittests/compiler/move-optimizer-unittest.cc |
diff --git a/test/unittests/compiler/move-optimizer-unittest.cc b/test/unittests/compiler/move-optimizer-unittest.cc |
index c7c92a0321baa1c75ff383826706bb84f26da8ef..9a31d2f770753d3bc17f318431cfb2b09df83b05 100644 |
--- a/test/unittests/compiler/move-optimizer-unittest.cc |
+++ b/test/unittests/compiler/move-optimizer-unittest.cc |
@@ -104,11 +104,18 @@ TEST_F(MoveOptimizerTest, RemovesRedundant) { |
TEST_F(MoveOptimizerTest, RemovesRedundantExplicit) { |
+ int first_reg_index = |
+ RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN) |
+ ->GetAllocatableGeneralCode(0); |
+ int second_reg_index = |
+ RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN) |
+ ->GetAllocatableGeneralCode(1); |
+ |
StartBlock(); |
auto first_instr = EmitNop(); |
- AddMove(first_instr, Reg(0), ExplicitReg(1)); |
+ AddMove(first_instr, Reg(first_reg_index), ExplicitReg(second_reg_index)); |
auto last_instr = EmitNop(); |
- AddMove(last_instr, Reg(1), Reg(0)); |
+ AddMove(last_instr, Reg(second_reg_index), Reg(first_reg_index)); |
EndBlock(Last()); |
Optimize(); |
@@ -116,7 +123,7 @@ TEST_F(MoveOptimizerTest, RemovesRedundantExplicit) { |
CHECK_EQ(0, NonRedundantSize(first_instr->parallel_moves()[0])); |
auto move = last_instr->parallel_moves()[0]; |
CHECK_EQ(1, NonRedundantSize(move)); |
- CHECK(Contains(move, Reg(0), ExplicitReg(1))); |
+ CHECK(Contains(move, Reg(first_reg_index), ExplicitReg(second_reg_index))); |
} |