Commit 8eabcb3f authored by akos.palfi's avatar akos.palfi Committed by Commit bot

Fix debug mode test failures on MIPS and PPC after f1aa5562.

TEST=cctest/test-gap-resolver/FuzzResolver,unittests/MoveOptimizerTest.RemovesRedundantExplicit
BUG=

Review URL: https://codereview.chromium.org/1403373016

Cr-Commit-Position: refs/heads/master@{#31629}
parent bf81c494
...@@ -213,10 +213,15 @@ class ParallelMoveCreator : public HandleAndZoneScope { ...@@ -213,10 +213,15 @@ class ParallelMoveCreator : public HandleAndZoneScope {
return AllocatedOperand(LocationOperand::REGISTER, RandomDoubleType(), return AllocatedOperand(LocationOperand::REGISTER, RandomDoubleType(),
index); index);
case 4: case 4:
return ExplicitOperand(LocationOperand::REGISTER, RandomType(), 1); return ExplicitOperand(
LocationOperand::REGISTER, RandomType(),
RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN)
->GetAllocatableGeneralCode(1));
case 5: case 5:
return ExplicitOperand(LocationOperand::STACK_SLOT, RandomType(), return ExplicitOperand(
index); LocationOperand::STACK_SLOT, RandomType(),
RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN)
->GetAllocatableGeneralCode(index));
case 6: case 6:
return ConstantOperand(index); return ConstantOperand(index);
} }
......
...@@ -104,11 +104,18 @@ TEST_F(MoveOptimizerTest, RemovesRedundant) { ...@@ -104,11 +104,18 @@ TEST_F(MoveOptimizerTest, RemovesRedundant) {
TEST_F(MoveOptimizerTest, RemovesRedundantExplicit) { 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(); StartBlock();
auto first_instr = EmitNop(); 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(); auto last_instr = EmitNop();
AddMove(last_instr, Reg(1), Reg(0)); AddMove(last_instr, Reg(second_reg_index), Reg(first_reg_index));
EndBlock(Last()); EndBlock(Last());
Optimize(); Optimize();
...@@ -116,7 +123,7 @@ TEST_F(MoveOptimizerTest, RemovesRedundantExplicit) { ...@@ -116,7 +123,7 @@ TEST_F(MoveOptimizerTest, RemovesRedundantExplicit) {
CHECK_EQ(0, NonRedundantSize(first_instr->parallel_moves()[0])); CHECK_EQ(0, NonRedundantSize(first_instr->parallel_moves()[0]));
auto move = last_instr->parallel_moves()[0]; auto move = last_instr->parallel_moves()[0];
CHECK_EQ(1, NonRedundantSize(move)); CHECK_EQ(1, NonRedundantSize(move));
CHECK(Contains(move, Reg(0), ExplicitReg(1))); CHECK(Contains(move, Reg(first_reg_index), ExplicitReg(second_reg_index)));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment