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 2452d19914da05f0c5eaf82ad28dc0373a24709d..5b956f077a9657821f21b2aa5e1614ae249f8781 100644 |
--- a/test/unittests/compiler/move-optimizer-unittest.cc |
+++ b/test/unittests/compiler/move-optimizer-unittest.cc |
@@ -12,7 +12,11 @@ |
class MoveOptimizerTest : public InstructionSequenceTest { |
public: |
GapInstruction* LastGap() { |
- return GapInstruction::cast(*(sequence()->instructions().rbegin() + 1)); |
+ auto instruction = sequence()->instructions().back(); |
+ if (!instruction->IsGapMoves()) { |
+ instruction = *(sequence()->instructions().rbegin() + 1); |
+ } |
+ return GapInstruction::cast(instruction); |
} |
void AddMove(GapInstruction* gap, TestOperand from, TestOperand to, |
@@ -86,10 +90,10 @@ |
TEST_F(MoveOptimizerTest, RemovesRedundant) { |
StartBlock(); |
- EmitNop(); |
AddMove(LastGap(), Reg(0), Reg(1)); |
EmitNop(); |
AddMove(LastGap(), Reg(1), Reg(0)); |
+ EmitNop(); |
EndBlock(Last()); |
Optimize(); |