1 ; RUN: llvm-as < %s | opt -mem2reg -disable-output
4 define void @printk(i32, ...) {
6 %flags = alloca i32 ; <i32*> [#uses=2]
7 br i1 false, label %then.0, label %endif.0
8 then.0: ; preds = %entry
10 endif.0: ; preds = %then.0, %entry
11 store i32 0, i32* %flags
13 loopentry: ; preds = %endif.3, %endif.0
14 br i1 false, label %no_exit, label %loopexit
15 no_exit: ; preds = %loopentry
16 br i1 false, label %then.1, label %endif.1
17 then.1: ; preds = %no_exit
18 br i1 false, label %shortcirc_done.0, label %shortcirc_next.0
19 shortcirc_next.0: ; preds = %then.1
20 br label %shortcirc_done.0
21 shortcirc_done.0: ; preds = %shortcirc_next.0, %then.1
22 br i1 false, label %shortcirc_done.1, label %shortcirc_next.1
23 shortcirc_next.1: ; preds = %shortcirc_done.0
24 br label %shortcirc_done.1
25 shortcirc_done.1: ; preds = %shortcirc_next.1, %shortcirc_done.0
26 br i1 false, label %shortcirc_done.2, label %shortcirc_next.2
27 shortcirc_next.2: ; preds = %shortcirc_done.1
28 br label %shortcirc_done.2
29 shortcirc_done.2: ; preds = %shortcirc_next.2, %shortcirc_done.1
30 br i1 false, label %then.2, label %endif.2
31 then.2: ; preds = %shortcirc_done.2
33 endif.2: ; preds = %then.2, %shortcirc_done.2
35 endif.1: ; preds = %endif.2, %no_exit
36 br i1 false, label %then.3, label %endif.3
37 then.3: ; preds = %endif.1
39 endif.3: ; preds = %then.3, %endif.1
41 loopexit: ; preds = %loopentry
43 then.4: ; No predecessors!
44 %tmp.61 = load i32* %flags ; <i32> [#uses=0]
46 dead_block_after_goto: ; No predecessors!
48 endif.4: ; preds = %dead_block_after_goto, %loopexit
49 br i1 false, label %then.5, label %else
50 then.5: ; preds = %endif.4
52 else: ; preds = %endif.4
54 endif.5: ; preds = %else, %then.5
56 out: ; preds = %endif.5, %then.4
58 after_ret: ; No predecessors!
60 return: ; preds = %after_ret, %out