blob: 6e7440e25b6c811f2d7c609169edf61436f7fdf0 [file] [log] [blame]
Nick Lewycky0efa9212009-07-29 05:17:50 +00001; RUN: llvm-as < %s | opt -simplify-libcalls
2; PR4641
3
4 %struct.__sFILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, i8*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64, %struct.pthread_mutex*, %struct.pthread*, i32, i32, %union.anon }
5 %struct.__sbuf = type { i8*, i32, [4 x i8] }
6 %struct.pthread = type opaque
7 %struct.pthread_mutex = type opaque
8 %union.anon = type { i64, [120 x i8] }
9@.str13 = external constant [2 x i8] ; <[2 x i8]*> [#uses=1]
10@.str14 = external constant [2 x i8] ; <[2 x i8]*> [#uses=1]
11
12define i32 @main(i32 %argc, i8** %argv) nounwind {
13entry:
14 br i1 undef, label %if.then.i, label %xmalloc.exit
15
16if.then.i: ; preds = %entry
17 unreachable
18
19xmalloc.exit: ; preds = %entry
20 br i1 undef, label %if.then.i11, label %xmalloc.exit13
21
22if.then.i11: ; preds = %xmalloc.exit
23 unreachable
24
25xmalloc.exit13: ; preds = %xmalloc.exit
26 br label %while.cond
27
28while.cond: ; preds = %sw.bb124, %if.end59, %if.end, %while.cond, %xmalloc.exit13
29 switch i32 undef, label %sw.default [
30 i32 -1, label %for.cond
31 i32 0, label %while.cond
32 i32 4097, label %sw.bb36
33 i32 102, label %sw.bb55
34 i32 111, label %sw.bb55
35 i32 108, label %sw.bb62
36 i32 99, label %sw.bb84
37 i32 86, label %sw.bb114
38 i32 66, label %sw.bb124
39 ]
40
41sw.bb36: ; preds = %while.cond
42 br i1 undef, label %if.end, label %if.then
43
44if.then: ; preds = %sw.bb36
45 unreachable
46
47if.end: ; preds = %sw.bb36
48 br label %while.cond
49
50sw.bb55: ; preds = %while.cond, %while.cond
51 br i1 undef, label %if.end59, label %if.then58
52
53if.then58: ; preds = %sw.bb55
54 br label %if.end59
55
56if.end59: ; preds = %if.then58, %sw.bb55
57 br label %while.cond
58
59sw.bb62: ; preds = %while.cond
60 unreachable
61
62sw.bb84: ; preds = %while.cond
63 unreachable
64
65sw.bb114: ; preds = %while.cond
66 unreachable
67
68sw.bb124: ; preds = %while.cond
69 br label %while.cond
70
71sw.default: ; preds = %while.cond
72 unreachable
73
74for.cond: ; preds = %while.cond
75 br i1 undef, label %if.end167, label %if.then8.i
76
77if.then8.i: ; preds = %for.cond
78 unreachable
79
80if.end167: ; preds = %for.cond
81 br i1 undef, label %if.then174, label %if.end175
82
83if.then174: ; preds = %if.end167
84 unreachable
85
86if.end175: ; preds = %if.end167
87 br i1 undef, label %if.then179, label %if.end181
88
89if.then179: ; preds = %if.end175
90 unreachable
91
92if.end181: ; preds = %if.end175
93 br i1 undef, label %if.then.i.i189, label %while.cond.i194
94
95if.then.i.i189: ; preds = %if.end181
96 unreachable
97
98while.cond.i194: ; preds = %if.end181
99 br i1 undef, label %while.body.i198, label %for.cond.i.i202
100
101while.body.i198: ; preds = %while.cond.i194
102 unreachable
103
104for.cond.i.i202: ; preds = %while.cond.i194
105 br i1 undef, label %if.end197, label %if.then191
106
107if.then191: ; preds = %for.cond.i.i202
108 unreachable
109
110if.end197: ; preds = %for.cond.i.i202
111 br label %for.cond.i144
112
113for.cond.i144: ; preds = %for.body.i145, %if.end197
114 br i1 undef, label %for.body.i145, label %for.cond24.i
115
116for.body.i145: ; preds = %for.cond.i144
117 br label %for.cond.i144
118
119for.cond24.i: ; preds = %for.cond.i144
120 br label %for.cond78.i
121
122for.cond78.i: ; preds = %for.body84.i, %for.cond24.i
123 br i1 undef, label %for.end94.i, label %for.body84.i
124
125for.body84.i: ; preds = %for.cond78.i
126 br label %for.cond78.i
127
128for.end94.i: ; preds = %for.cond78.i
129 br i1 undef, label %if.then.i.i139, label %linebuffer_init.exit142
130
131if.then.i.i139: ; preds = %for.end94.i
132 br label %linebuffer_init.exit142
133
134linebuffer_init.exit142: ; preds = %if.then.i.i139, %for.end94.i
135 br i1 undef, label %if.then.i.i124, label %linebuffer_init.exit129
136
137if.then.i.i124: ; preds = %linebuffer_init.exit142
138 unreachable
139
140linebuffer_init.exit129: ; preds = %linebuffer_init.exit142
141 br i1 undef, label %if.then.i.i110, label %linebuffer_init.exit113
142
143if.then.i.i110: ; preds = %linebuffer_init.exit129
144 unreachable
145
146linebuffer_init.exit113: ; preds = %linebuffer_init.exit129
147 br i1 undef, label %if.then.i.i98, label %linebuffer_init.exit
148
149if.then.i.i98: ; preds = %linebuffer_init.exit113
150 br label %linebuffer_init.exit
151
152linebuffer_init.exit: ; preds = %if.then.i.i98, %linebuffer_init.exit113
153 br i1 undef, label %if.then227, label %while.cond.i50
154
155if.then227: ; preds = %linebuffer_init.exit
156 unreachable
157
158while.cond.i50: ; preds = %linebuffer_init.exit
159 br i1 undef, label %while.end339, label %while.body334
160
161while.body334: ; preds = %while.cond.i50
162 unreachable
163
164while.end339: ; preds = %while.cond.i50
165 br i1 undef, label %if.then344, label %if.end346
166
167if.then344: ; preds = %while.end339
168 unreachable
169
170if.end346: ; preds = %while.end339
171 call void @exit(i32 0) nounwind
172 %cond392 = select i1 undef, i8* getelementptr ([2 x i8]* @.str13, i32 0, i32 0), i8* getelementptr ([2 x i8]* @.str14, i32 0, i32 0) ; <i8*> [#uses=1]
173 %call393 = call %struct.__sFILE* @fopen(i8* undef, i8* %cond392) nounwind ; <%struct.__sFILE*> [#uses=0]
174 unreachable
175}
176
177declare %struct.__sFILE* @fopen(i8*, i8*)
178
179declare void @exit(i32)