New testcase that crashes the loop extractor
[oota-llvm.git] / test / Transforms / CodeExtractor / 2004-03-13-LoopExtractorCrash.ll
1 ; RUN: llvm-as < %s | opt -loop-extract -disable-output
2
3 void %solve() {
4 entry:
5         br label %loopentry.0
6
7 loopentry.0:            ; preds = %entry, %endif.0
8         br bool false, label %no_exit.0, label %loopexit.0
9
10 no_exit.0:              ; preds = %loopentry.0
11         br bool false, label %then.0, label %endif.0
12
13 then.0:         ; preds = %no_exit.0
14         br bool false, label %shortcirc_done, label %shortcirc_next
15
16 shortcirc_next:         ; preds = %then.0
17         br label %shortcirc_done
18
19 shortcirc_done:         ; preds = %then.0, %shortcirc_next
20         br bool false, label %then.1, label %endif.1
21
22 then.1:         ; preds = %shortcirc_done
23         br bool false, label %cond_true, label %cond_false
24
25 cond_true:              ; preds = %then.1
26         br label %cond_continue
27
28 cond_false:             ; preds = %then.1
29         br label %cond_continue
30
31 cond_continue:          ; preds = %cond_true, %cond_false
32         br label %return
33
34 after_ret.0:            ; No predecessors!
35         br label %endif.1
36
37 endif.1:                ; preds = %shortcirc_done, %after_ret.0
38         br label %endif.0
39
40 endif.0:                ; preds = %no_exit.0, %endif.1
41         br label %loopentry.0
42
43 loopexit.0:             ; preds = %loopentry.0
44         br bool false, label %then.2, label %endif.2
45
46 then.2:         ; preds = %loopexit.0
47         br bool false, label %then.3, label %endif.3
48
49 then.3:         ; preds = %then.2
50         br label %return
51
52 after_ret.1:            ; No predecessors!
53         br label %endif.3
54
55 endif.3:                ; preds = %then.2, %after_ret.1
56         br label %endif.2
57
58 endif.2:                ; preds = %loopexit.0, %endif.3
59         br label %loopentry.1
60
61 loopentry.1:            ; preds = %endif.2, %no_exit.1
62         br bool false, label %no_exit.1, label %loopexit.1
63
64 no_exit.1:              ; preds = %loopentry.1
65         br label %loopentry.1
66
67 loopexit.1:             ; preds = %loopentry.1
68         br label %return
69
70 after_ret.2:            ; No predecessors!
71         br label %return
72
73 return:         ; preds = %cond_continue, %then.3, %loopexit.1, %after_ret.2
74         ret void
75 }