Skip to content

Commit

Permalink
added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
yhls committed Jun 23, 2019
1 parent 763b42f commit 00b82d4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/compiler/ssair.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,19 @@ let
Meta.isexpr(ex, :meta)
end
end

# PR #32145
# Make sure IncrementalCompact can handle blocks with predecessors of index 0
# while removing blocks with no predecessors.
let cfg = CFG(BasicBlock[
make_bb([] , [2, 4]),
make_bb([1] , [4, 5]),
make_bb([] , [4] ), # should be removed
make_bb([0, 1, 2] , [5] ), # 0 predecessor should be preserved
make_bb([2, 3] , [] ),
], Int[])
code = Compiler.IRCode(
[], [], Int32[], UInt8[], cfg, LineInfoNode[], [], [], [])
compact = Compiler.IncrementalCompact(code, true)
@test length(compact.result_bbs) == 4 && 0 in compact.result_bbs[3].preds
end

0 comments on commit 00b82d4

Please sign in to comment.