Index: test/cctest/compiler/test-instruction.cc |
diff --git a/test/cctest/compiler/test-instruction.cc b/test/cctest/compiler/test-instruction.cc |
index f1c9bcdb4afed0b3942e9a05b531e6f6c9fd2f14..294812fdfb7161fb8498b5349766ae63e0e6d74a 100644 |
--- a/test/cctest/compiler/test-instruction.cc |
+++ b/test/cctest/compiler/test-instruction.cc |
@@ -214,10 +214,14 @@ |
R.code->AddInstruction(g); |
R.code->EndBlock(b0->GetRpoNumber()); |
- CHECK(R.code->instructions().size() == 4); |
- for (size_t i = 0; i < R.code->instructions().size(); ++i) { |
- CHECK_EQ(i % 2 == 0, R.code->instructions()[i]->IsGapMoves()); |
- } |
+ CHECK_EQ(true, R.code->InstructionAt(0)->IsBlockStart()); |
+ |
+ CHECK_EQ(true, R.code->IsGapAt(0)); // Label |
+ CHECK_EQ(true, R.code->IsGapAt(1)); // Gap |
+ CHECK_EQ(false, R.code->IsGapAt(2)); // i0 |
+ CHECK_EQ(true, R.code->IsGapAt(3)); // Gap |
+ CHECK_EQ(true, R.code->IsGapAt(4)); // Gap |
+ CHECK_EQ(false, R.code->IsGapAt(5)); // g |
} |
@@ -244,10 +248,23 @@ |
R.code->AddInstruction(g1); |
R.code->EndBlock(b1->GetRpoNumber()); |
- CHECK(R.code->instructions().size() == 8); |
- for (size_t i = 0; i < R.code->instructions().size(); ++i) { |
- CHECK_EQ(i % 2 == 0, R.code->instructions()[i]->IsGapMoves()); |
- } |
+ CHECK_EQ(true, R.code->InstructionAt(0)->IsBlockStart()); |
+ |
+ CHECK_EQ(true, R.code->IsGapAt(0)); // Label |
+ CHECK_EQ(true, R.code->IsGapAt(1)); // Gap |
+ CHECK_EQ(false, R.code->IsGapAt(2)); // i0 |
+ CHECK_EQ(true, R.code->IsGapAt(3)); // Gap |
+ CHECK_EQ(true, R.code->IsGapAt(4)); // Gap |
+ CHECK_EQ(false, R.code->IsGapAt(5)); // g |
+ |
+ CHECK_EQ(true, R.code->InstructionAt(6)->IsBlockStart()); |
+ |
+ CHECK_EQ(true, R.code->IsGapAt(6)); // Label |
+ CHECK_EQ(true, R.code->IsGapAt(7)); // Gap |
+ CHECK_EQ(false, R.code->IsGapAt(8)); // i1 |
+ CHECK_EQ(true, R.code->IsGapAt(9)); // Gap |
+ CHECK_EQ(true, R.code->IsGapAt(10)); // Gap |
+ CHECK_EQ(false, R.code->IsGapAt(11)); // g1 |
} |
@@ -265,12 +282,16 @@ |
R.code->AddInstruction(g); |
R.code->EndBlock(b0->GetRpoNumber()); |
- CHECK(R.code->instructions().size() == 4); |
- for (size_t i = 0; i < R.code->instructions().size(); ++i) { |
- CHECK_EQ(i % 2 == 0, R.code->instructions()[i]->IsGapMoves()); |
- } |
- |
- int indexes[] = {0, 2, -1}; |
+ CHECK_EQ(true, R.code->InstructionAt(0)->IsBlockStart()); |
+ |
+ CHECK_EQ(true, R.code->IsGapAt(0)); // Label |
+ CHECK_EQ(true, R.code->IsGapAt(1)); // Gap |
+ CHECK_EQ(false, R.code->IsGapAt(2)); // i0 |
+ CHECK_EQ(true, R.code->IsGapAt(3)); // Gap |
+ CHECK_EQ(true, R.code->IsGapAt(4)); // Gap |
+ CHECK_EQ(false, R.code->IsGapAt(5)); // g |
+ |
+ int indexes[] = {0, 1, 3, 4, -1}; |
for (int i = 0; indexes[i] >= 0; i++) { |
int index = indexes[i]; |