Readonly/readnone functions are allowed to throw
[oota-llvm.git] / test / Transforms / ADCE / 2003-06-24-BadSuccessor.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -adce -disable-output
2
3 target endian = little
4 target pointersize = 32
5         %struct..CppObjTypeDesc = type { uint, ushort, ushort }
6         %struct..TypeToken = type { uint, ushort, ushort }
7
8 implementation   ; Functions:
9
10 uint %C_ReFaxToDb() {
11 entry:          ; No predecessors!
12         br bool false, label %endif.0, label %then.0
13
14 then.0:         ; preds = %entry
15         ret uint 0
16
17 endif.0:                ; preds = %entry
18         br bool false, label %then.11, label %then.4
19
20 then.4:         ; preds = %endif.0
21         ret uint 0
22
23 then.11:                ; preds = %endif.0
24         br bool false, label %loopentry.0, label %else.2
25
26 loopentry.0:            ; preds = %then.11, %endif.14, %loopentry.1
27         br bool false, label %endif.14, label %loopexit.0
28
29 endif.14:               ; preds = %loopentry.0
30         br bool false, label %loopentry.1, label %loopentry.0
31
32 loopentry.1:            ; preds = %endif.14, %then.53, %then.53, %then.53, %then.53, %then.53
33         %SubArrays.10 = phi uint* [ %SubArrays.8, %then.53 ] , [ null, %endif.14 ]              ; <uint*> [#uses=3]
34         br bool false, label %no_exit.1, label %loopentry.0
35
36 no_exit.1:              ; preds = %loopentry.1
37         switch uint 0, label %label.17 [
38                  uint 2, label %label.11
39                  uint 19, label %label.10
40         ]
41
42 label.10:               ; preds = %no_exit.1
43         br bool false, label %then.43, label %endif.43
44
45 then.43:                ; preds = %label.10
46         br bool false, label %then.44, label %endif.44
47
48 then.44:                ; preds = %then.43
49         br bool false, label %shortcirc_next.4, label %endif.45
50
51 shortcirc_next.4:               ; preds = %then.44
52         br bool false, label %no_exit.2, label %loopexit.2
53
54 no_exit.2:              ; preds = %shortcirc_next.4
55         %tmp.897 = getelementptr uint* %SubArrays.10, long 0            ; <uint*> [#uses=1]
56         %tmp.899 = load uint* %tmp.897          ; <uint> [#uses=1]
57         store uint %tmp.899, uint* null
58         ret uint 0
59
60 loopexit.2:             ; preds = %shortcirc_next.4
61         ret uint 0
62
63 endif.45:               ; preds = %then.44
64         ret uint 0
65
66 endif.44:               ; preds = %then.43
67         ret uint 0
68
69 endif.43:               ; preds = %label.10
70         ret uint 0
71
72 label.11:               ; preds = %no_exit.1
73         ret uint 0
74
75 label.17:               ; preds = %no_exit.1, %no_exit.1, %no_exit.1, %no_exit.1, %no_exit.1, %no_exit.1
76         br bool false, label %then.53, label %shortcirc_next.7
77
78 shortcirc_next.7:               ; preds = %label.17
79         br bool false, label %then.53, label %shortcirc_next.8
80
81 shortcirc_next.8:               ; preds = %shortcirc_next.7
82         ret uint 0
83
84 then.53:                ; preds = %shortcirc_next.7, %label.17
85         %SubArrays.8 = phi uint* [ %SubArrays.10, %shortcirc_next.7 ], [ %SubArrays.10, %label.17 ]             ; <uint*> [#uses=5]
86         %tmp.1023 = load uint* null             ; <uint> [#uses=1]
87         switch uint %tmp.1023, label %loopentry.1 []
88
89 loopexit.0:             ; preds = %loopentry.0
90         ret uint 0
91
92 else.2:         ; preds = %then.11
93         ret uint 0
94 }