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}
This commit is contained in:
akos.palfi 2015-10-28 06:04:14 -07:00 committed by Commit bot
parent bf81c494a4
commit 8eabcb3fb6
2 changed files with 18 additions and 6 deletions

View File

@ -213,10 +213,15 @@ class ParallelMoveCreator : public HandleAndZoneScope {
return AllocatedOperand(LocationOperand::REGISTER, RandomDoubleType(),
index);
case 4:
return ExplicitOperand(LocationOperand::REGISTER, RandomType(), 1);
return ExplicitOperand(
LocationOperand::REGISTER, RandomType(),
RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN)
->GetAllocatableGeneralCode(1));
case 5:
return ExplicitOperand(LocationOperand::STACK_SLOT, RandomType(),
index);
return ExplicitOperand(
LocationOperand::STACK_SLOT, RandomType(),
RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN)
->GetAllocatableGeneralCode(index));
case 6:
return ConstantOperand(index);
}

View File

@ -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)));
}