Upgrade tests.
[oota-llvm.git] / test / Transforms / Mem2Reg / 2005-11-28-Crash.ll
1 ; RUN: llvm-as < %s | opt -mem2reg -disable-output
2 ; PR670
3
4 define void @printk(i32, ...) {
5 entry:
6         %flags = alloca i32             ; <i32*> [#uses=2]
7         br i1 false, label %then.0, label %endif.0
8 then.0:         ; preds = %entry
9         br label %endif.0
10 endif.0:                ; preds = %then.0, %entry
11         store i32 0, i32* %flags
12         br label %loopentry
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
32         br label %endif.2
33 endif.2:                ; preds = %then.2, %shortcirc_done.2
34         br label %endif.1
35 endif.1:                ; preds = %endif.2, %no_exit
36         br i1 false, label %then.3, label %endif.3
37 then.3:         ; preds = %endif.1
38         br label %endif.3
39 endif.3:                ; preds = %then.3, %endif.1
40         br label %loopentry
41 loopexit:               ; preds = %loopentry
42         br label %endif.4
43 then.4:         ; No predecessors!
44         %tmp.61 = load i32* %flags              ; <i32> [#uses=0]
45         br label %out
46 dead_block_after_goto:          ; No predecessors!
47         br label %endif.4
48 endif.4:                ; preds = %dead_block_after_goto, %loopexit
49         br i1 false, label %then.5, label %else
50 then.5:         ; preds = %endif.4
51         br label %endif.5
52 else:           ; preds = %endif.4
53         br label %endif.5
54 endif.5:                ; preds = %else, %then.5
55         br label %out
56 out:            ; preds = %endif.5, %then.4
57         br label %return
58 after_ret:              ; No predecessors!
59         br label %return
60 return:         ; preds = %after_ret, %out
61         ret void
62 }