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 fb2b6ad45739ac76ce1c3e685530243a080d1479..c7c92a0321baa1c75ff383826706bb84f26da8ef 100644 |
--- a/test/unittests/compiler/move-optimizer-unittest.cc |
+++ b/test/unittests/compiler/move-optimizer-unittest.cc |
@@ -67,10 +67,16 @@ class MoveOptimizerTest : public InstructionSequenceTest { |
case kConstant: |
return ConstantOperand(op.value_); |
case kFixedSlot: |
- return StackSlotOperand(kRepWord32, op.value_); |
+ return AllocatedOperand(LocationOperand::STACK_SLOT, kRepWord32, |
+ op.value_); |
case kFixedRegister: |
CHECK(0 <= op.value_ && op.value_ < num_general_registers()); |
- return RegisterOperand(kRepWord32, op.value_); |
+ return AllocatedOperand(LocationOperand::REGISTER, kRepWord32, |
+ op.value_); |
+ case kExplicit: |
+ CHECK(0 <= op.value_ && op.value_ < num_general_registers()); |
+ return ExplicitOperand(LocationOperand::REGISTER, kRepWord32, |
+ op.value_); |
default: |
break; |
} |
@@ -97,6 +103,23 @@ TEST_F(MoveOptimizerTest, RemovesRedundant) { |
} |
+TEST_F(MoveOptimizerTest, RemovesRedundantExplicit) { |
+ StartBlock(); |
+ auto first_instr = EmitNop(); |
+ AddMove(first_instr, Reg(0), ExplicitReg(1)); |
+ auto last_instr = EmitNop(); |
+ AddMove(last_instr, Reg(1), Reg(0)); |
+ EndBlock(Last()); |
+ |
+ Optimize(); |
+ |
+ 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))); |
+} |
+ |
+ |
TEST_F(MoveOptimizerTest, SplitsConstants) { |
StartBlock(); |
EndBlock(Last()); |