Index: test/unittests/compiler/instruction-sequence-unittest.cc |
diff --git a/test/unittests/compiler/instruction-sequence-unittest.cc b/test/unittests/compiler/instruction-sequence-unittest.cc |
index abc53940efe4c45aafb228e10892bc8af992c29d..f659b07887fbcbf02e4ff400abb15030f3a7c3d1 100644 |
--- a/test/unittests/compiler/instruction-sequence-unittest.cc |
+++ b/test/unittests/compiler/instruction-sequence-unittest.cc |
@@ -109,7 +109,7 @@ Instruction* InstructionSequenceTest::EndBlock(BlockCompletion completion) { |
case kBlockEnd: |
break; |
case kFallThrough: |
- result = EmitFallThrough(); |
+ result = EmitJump(); |
break; |
case kJump: |
CHECK(!block_returns_); |
@@ -441,11 +441,20 @@ InstructionBlock* InstructionSequenceTest::NewBlock() { |
void InstructionSequenceTest::WireBlocks() { |
CHECK(!current_block()); |
CHECK(instruction_blocks_.size() == completions_.size()); |
+ CHECK(loop_blocks_.empty()); |
+ // Wire in end block to look like a scheduler produced cfg. |
+ auto end_block = NewBlock(); |
+ current_block_ = nullptr; |
+ sequence()->EndBlock(end_block->rpo_number()); |
size_t offset = 0; |
for (const auto& completion : completions_) { |
switch (completion.type_) { |
- case kBlockEnd: |
+ case kBlockEnd: { |
+ auto block = instruction_blocks_[offset]; |
+ block->successors().push_back(end_block->rpo_number()); |
+ end_block->predecessors().push_back(block->rpo_number()); |
break; |
+ } |
case kFallThrough: // Fallthrough. |
case kJump: |
WireBlock(offset, completion.offset_0_); |