llvm.org GIT mirror llvm / bf0fb17
Let's try to have our cake and eat it to: move this test into FrontendC to ensure that llvm-gcc is available; assemble using "llvm-gcc -xassembler" rather than "as". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62683 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan Sands 11 years ago
2 changed file(s) with 282 addition(s) and 282 deletion(s). Raw diff Collapse all Expand all
+0
-282
test/CodeGen/Generic/2008-07-29-EHLabel.ll less more
None ; RUN: llvm-as < %s | llc
1 ; PR2609
2 %struct..0._11 = type { i32 }
3 %struct..1__pthread_mutex_s = type { i32, i32, i32, i32, i32, %struct..0._11 }
4 %struct.pthread_attr_t = type { i32, [32 x i8] }
5 %struct.pthread_mutex_t = type { %struct..1__pthread_mutex_s }
6 %"struct.std::__ctype_abstract_base" = type { %"struct.std::locale::facet" }
7 %"struct.std::basic_ios >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream >"*, i8, i8, %"struct.std::basic_streambuf >"*, %"struct.std::ctype"*, %"struct.std::__ctype_abstract_base"*, %"struct.std::__ctype_abstract_base"* }
8 %"struct.std::basic_istream >" = type { i32 (...)**, i32, %"struct.std::basic_ios >" }
9 %"struct.std::basic_istream >::sentry" = type { i8 }
10 %"struct.std::basic_ostream >" = type { i32 (...)**, %"struct.std::basic_ios >" }
11 %"struct.std::basic_streambuf >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %"struct.std::locale" }
12 %"struct.std::ctype" = type { %"struct.std::locale::facet", i32*, i8, i32*, i32*, i16*, i8, [256 x i8], [256 x i8], i8 }
13 %"struct.std::ios_base" = type { i32 (...)**, i32, i32, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, %"struct.std::ios_base::_Words"*, %"struct.std::locale" }
14 %"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 }
15 %"struct.std::ios_base::_Words" = type { i8*, i32 }
16 %"struct.std::locale" = type { %"struct.std::locale::_Impl"* }
17 %"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i32, %"struct.std::locale::facet"**, i8** }
18 %"struct.std::locale::facet" = type { i32 (...)**, i32 }
19
20 @_ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; [#uses=0]
21 @_ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; [#uses=0]
22 @_ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; [#uses=0]
23 @_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; [#uses=0]
24 @_ZL22__gthrw_pthread_cancelm = alias weak i32 (i32)* @pthread_cancel ; [#uses=0]
25 @_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; [#uses=0]
26 @_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; [#uses=0]
27 @_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; [#uses=0]
28 @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%struct.pthread_mutex_t*, %struct..0._11*)* @pthread_mutex_init ; [#uses=0]
29 @_ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; [#uses=0]
30 @_ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; [#uses=0]
31 @_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%struct..0._11*)* @pthread_mutexattr_init ; [#uses=0]
32 @_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%struct..0._11*, i32)* @pthread_mutexattr_settype ; [#uses=0]
33 @_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%struct..0._11*)* @pthread_mutexattr_destroy ; [#uses=0]
34
35 define %"struct.std::basic_istream >"* @_ZNSi7getlineEPcic(%"struct.std::basic_istream >"* %this, i8* %__s, i32 %__n, i8 signext %__delim) {
36 entry:
37 %__cerb = alloca %"struct.std::basic_istream >::sentry" ; <%"struct.std::basic_istream >::sentry"*> [#uses=2]
38 getelementptr %"struct.std::basic_istream >"* %this, i32 0, i32 1 ; :0 [#uses=7]
39 store i32 0, i32* %0, align 4
40 call void @_ZNSi6sentryC1ERSib( %"struct.std::basic_istream >::sentry"* %__cerb, %"struct.std::basic_istream >"* %this, i8 zeroext 1 )
41 getelementptr %"struct.std::basic_istream >::sentry"* %__cerb, i32 0, i32 0 ; :1 [#uses=1]
42 load i8* %1, align 8 ; :2 [#uses=1]
43 %toBool = icmp eq i8 %2, 0 ; [#uses=1]
44 br i1 %toBool, label %bb162, label %bb
45
46 bb: ; preds = %entry
47 zext i8 %__delim to i32 ; :3 [#uses=1]
48 getelementptr %"struct.std::basic_istream >"* %this, i32 0, i32 0 ; :4 [#uses=1]
49 load i32 (...)*** %4, align 4 ; :5 [#uses=1]
50 getelementptr i32 (...)** %5, i32 -3 ; :6 [#uses=1]
51 bitcast i32 (...)** %6 to i32* ; :7 [#uses=1]
52 load i32* %7, align 4 ; :8 [#uses=1]
53 bitcast %"struct.std::basic_istream >"* %this to i8* ; :9 [#uses=1]
54 %ctg2186 = getelementptr i8* %9, i32 %8 ; [#uses=1]
55 bitcast i8* %ctg2186 to %"struct.std::basic_ios >"* ; <%"struct.std::basic_ios >"*>:10 [#uses=1]
56 getelementptr %"struct.std::basic_ios >"* %10, i32 0, i32 4 ; <%"struct.std::basic_streambuf >"**>:11 [#uses=1]
57 load %"struct.std::basic_streambuf >"** %11, align 4 ; <%"struct.std::basic_streambuf >"*>:12 [#uses=9]
58 getelementptr %"struct.std::basic_streambuf >"* %12, i32 0, i32 2 ; :13 [#uses=10]
59 load i8** %13, align 4 ; :14 [#uses=2]
60 getelementptr %"struct.std::basic_streambuf >"* %12, i32 0, i32 3 ; :15 [#uses=6]
61 load i8** %15, align 4 ; :16 [#uses=1]
62 icmp ult i8* %14, %16 ; :17 [#uses=1]
63 br i1 %17, label %bb81, label %bb82
64
65 bb81: ; preds = %bb
66 load i8* %14, align 1 ; :18 [#uses=1]
67 zext i8 %18 to i32 ; :19 [#uses=1]
68 %.pre = getelementptr %"struct.std::basic_streambuf >"* %12, i32 0, i32 0 ; [#uses=1]
69 br label %bb119.preheader
70
71 bb82: ; preds = %bb
72 getelementptr %"struct.std::basic_streambuf >"* %12, i32 0, i32 0 ; :20 [#uses=2]
73 load i32 (...)*** %20, align 4 ; :21 [#uses=1]
74 getelementptr i32 (...)** %21, i32 9 ; :22 [#uses=1]
75 load i32 (...)** %22, align 4 ; :23 [#uses=1]
76 bitcast i32 (...)* %23 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:24 [#uses=1]
77 invoke i32 %24( %"struct.std::basic_streambuf >"* %12 )
78 to label %bb119.preheader unwind label %lpad ; :25 [#uses=1]
79
80 bb119.preheader: ; preds = %bb82, %bb81
81 %.pre-phi = phi i32 (...)*** [ %.pre, %bb81 ], [ %20, %bb82 ] ; [#uses=4]
82 %__c79.0.ph = phi i32 [ %19, %bb81 ], [ %25, %bb82 ] ; [#uses=1]
83 sext i8 %__delim to i32 ; :26 [#uses=1]
84 br label %bb119
85
86 bb84: ; preds = %bb119
87 sub i32 %__n, %82 ; :27 [#uses=1]
88 add i32 %27, -1 ; :28 [#uses=2]
89 load i8** %15, align 4 ; :29 [#uses=1]
90 ptrtoint i8* %29 to i32 ; :30 [#uses=1]
91 load i8** %13, align 4 ; :31 [#uses=3]
92 ptrtoint i8* %31 to i32 ; :32 [#uses=2]
93 sub i32 %30, %32 ; :33 [#uses=2]
94 icmp slt i32 %28, %33 ; :34 [#uses=1]
95 select i1 %34, i32 %28, i32 %33 ; :35 [#uses=3]
96 icmp sgt i32 %35, 1 ; :36 [#uses=1]
97 br i1 %36, label %bb90, label %bb99
98
99 bb90: ; preds = %bb84
100 call i8* @memchr( i8* %31, i32 %26, i32 %35 ) nounwind readonly ; :37 [#uses=2]
101 icmp eq i8* %37, null ; :38 [#uses=1]
102 br i1 %38, label %bb93, label %bb92
103
104 bb92: ; preds = %bb90
105 ptrtoint i8* %37 to i32 ; :39 [#uses=1]
106 sub i32 %39, %32 ; :40 [#uses=1]
107 br label %bb93
108
109 bb93: ; preds = %bb92, %bb90
110 %__size.0 = phi i32 [ %40, %bb92 ], [ %35, %bb90 ] ; [#uses=4]
111 call void @llvm.memcpy.i32( i8* %__s_addr.0, i8* %31, i32 %__size.0, i32 1 )
112 getelementptr i8* %__s_addr.0, i32 %__size.0 ; :41 [#uses=3]
113 load i8** %13, align 4 ; :42 [#uses=1]
114 getelementptr i8* %42, i32 %__size.0 ; :43 [#uses=1]
115 store i8* %43, i8** %13, align 4
116 load i32* %0, align 4 ; :44 [#uses=1]
117 add i32 %44, %__size.0 ; :45 [#uses=1]
118 store i32 %45, i32* %0, align 4
119 load i8** %13, align 4 ; :46 [#uses=2]
120 load i8** %15, align 4 ; :47 [#uses=1]
121 icmp ult i8* %46, %47 ; :48 [#uses=1]
122 br i1 %48, label %bb95, label %bb96
123
124 bb95: ; preds = %bb93
125 load i8* %46, align 1 ; :49 [#uses=1]
126 zext i8 %49 to i32 ; :50 [#uses=1]
127 br label %bb119
128
129 bb96: ; preds = %bb93
130 load i32 (...)*** %.pre-phi, align 4 ; :51 [#uses=1]
131 getelementptr i32 (...)** %51, i32 9 ; :52 [#uses=1]
132 load i32 (...)** %52, align 4 ; :53 [#uses=1]
133 bitcast i32 (...)* %53 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:54 [#uses=1]
134 invoke i32 %54( %"struct.std::basic_streambuf >"* %12 )
135 to label %bb119 unwind label %lpad ; :55 [#uses=1]
136
137 bb99: ; preds = %bb84
138 trunc i32 %__c79.0 to i8 ; :56 [#uses=1]
139 store i8 %56, i8* %__s_addr.0, align 1
140 getelementptr i8* %__s_addr.0, i32 1 ; :57 [#uses=5]
141 load i32* %0, align 4 ; :58 [#uses=1]
142 add i32 %58, 1 ; :59 [#uses=1]
143 store i32 %59, i32* %0, align 4
144 load i8** %13, align 4 ; :60 [#uses=3]
145 load i8** %15, align 4 ; :61 [#uses=1]
146 icmp ult i8* %60, %61 ; :62 [#uses=1]
147 br i1 %62, label %bb101, label %bb102
148
149 bb101: ; preds = %bb99
150 load i8* %60, align 1 ; :63 [#uses=1]
151 zext i8 %63 to i32 ; :64 [#uses=1]
152 getelementptr i8* %60, i32 1 ; :65 [#uses=1]
153 store i8* %65, i8** %13, align 4
154 br label %bb104
155
156 bb102: ; preds = %bb99
157 load i32 (...)*** %.pre-phi, align 4 ; :66 [#uses=1]
158 getelementptr i32 (...)** %66, i32 10 ; :67 [#uses=1]
159 load i32 (...)** %67, align 4 ; :68 [#uses=1]
160 bitcast i32 (...)* %68 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:69 [#uses=1]
161 invoke i32 %69( %"struct.std::basic_streambuf >"* %12 )
162 to label %bb104 unwind label %lpad ; :70 [#uses=1]
163
164 bb104: ; preds = %bb102, %bb101
165 %__ret44.0 = phi i32 [ %64, %bb101 ], [ %70, %bb102 ] ; [#uses=1]
166 icmp eq i32 %__ret44.0, -1 ; :71 [#uses=1]
167 br i1 %71, label %bb119, label %bb112
168
169 bb112: ; preds = %bb104
170 load i8** %13, align 4 ; :72 [#uses=2]
171 load i8** %15, align 4 ; :73 [#uses=1]
172 icmp ult i8* %72, %73 ; :74 [#uses=1]
173 br i1 %74, label %bb114, label %bb115
174
175 bb114: ; preds = %bb112
176 load i8* %72, align 1 ; :75 [#uses=1]
177 zext i8 %75 to i32 ; :76 [#uses=1]
178 br label %bb119
179
180 bb115: ; preds = %bb112
181 load i32 (...)*** %.pre-phi, align 4 ; :77 [#uses=1]
182 getelementptr i32 (...)** %77, i32 9 ; :78 [#uses=1]
183 load i32 (...)** %78, align 4 ; :79 [#uses=1]
184 bitcast i32 (...)* %79 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:80 [#uses=1]
185 invoke i32 %80( %"struct.std::basic_streambuf >"* %12 )
186 to label %bb119 unwind label %lpad ; :81 [#uses=1]
187
188 bb119: ; preds = %bb115, %bb114, %bb104, %bb96, %bb95, %bb119.preheader
189 %__c79.0 = phi i32 [ %__c79.0.ph, %bb119.preheader ], [ %50, %bb95 ], [ %76, %bb114 ], [ %55, %bb96 ], [ -1, %bb104 ], [ %81, %bb115 ] ; [#uses=3]
190 %__s_addr.0 = phi i8* [ %__s, %bb119.preheader ], [ %41, %bb95 ], [ %57, %bb114 ], [ %41, %bb96 ], [ %57, %bb104 ], [ %57, %bb115 ] ; [#uses=5]
191 load i32* %0, align 4 ; :82 [#uses=2]
192 add i32 %82, 1 ; :83 [#uses=2]
193 %.not = icmp sge i32 %83, %__n ; [#uses=1]
194 icmp eq i32 %__c79.0, -1 ; :84 [#uses=3]
195 icmp eq i32 %__c79.0, %3 ; :85 [#uses=2]
196 %or.cond = or i1 %84, %85 ; [#uses=1]
197 %or.cond188 = or i1 %or.cond, %.not ; [#uses=1]
198 br i1 %or.cond188, label %bb141, label %bb84
199
200 bb141: ; preds = %bb119
201 %.not194 = xor i1 %85, true ; [#uses=1]
202 %brmerge = or i1 %84, %.not194 ; [#uses=1]
203 %.mux = select i1 %84, i32 2, i32 4 ; [#uses=0]
204 br i1 %brmerge, label %bb162, label %bb146
205
206 bb146: ; preds = %bb141
207 store i32 %83, i32* %0, align 4
208 load i8** %13, align 4 ; :86 [#uses=2]
209 load i8** %15, align 4 ; :87 [#uses=1]
210 icmp ult i8* %86, %87 ; :88 [#uses=1]
211 br i1 %88, label %bb148, label %bb149
212
213 bb148: ; preds = %bb146
214 getelementptr i8* %86, i32 1 ; :89 [#uses=1]
215 store i8* %89, i8** %13, align 4
216 ret %"struct.std::basic_istream >"* %this
217
218 bb149: ; preds = %bb146
219 load i32 (...)*** %.pre-phi, align 4 ; :90 [#uses=1]
220 getelementptr i32 (...)** %90, i32 10 ; :91 [#uses=1]
221 load i32 (...)** %91, align 4 ; :92 [#uses=1]
222 bitcast i32 (...)* %92 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:93 [#uses=1]
223 invoke i32 %93( %"struct.std::basic_streambuf >"* %12 )
224 to label %bb162 unwind label %lpad ; :94 [#uses=0]
225
226 bb162: ; preds = %bb149, %bb141, %entry
227 ret %"struct.std::basic_istream >"* %this
228
229 lpad: ; preds = %bb149, %bb115, %bb102, %bb96, %bb82
230 %__s_addr.1 = phi i8* [ %__s, %bb82 ], [ %__s_addr.0, %bb149 ], [ %41, %bb96 ], [ %57, %bb102 ], [ %57, %bb115 ] ; [#uses=0]
231 call void @__cxa_rethrow( ) noreturn
232 unreachable
233 }
234
235 declare i8* @__cxa_begin_catch(i8*) nounwind
236
237 declare i8* @llvm.eh.exception() nounwind
238
239 declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) nounwind
240
241 declare void @__cxa_rethrow() noreturn
242
243 declare void @__cxa_end_catch()
244
245 declare i32 @__gxx_personality_v0(...)
246
247 declare void @_ZNSi6sentryC1ERSib(%"struct.std::basic_istream >::sentry"*, %"struct.std::basic_istream >"*, i8 zeroext )
248
249 declare i8* @memchr(i8*, i32, i32) nounwind readonly
250
251 declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
252
253 declare void @_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate(%"struct.std::basic_ios >"*, i32)
254
255 declare extern_weak i32 @pthread_once(i32*, void ()*)
256
257 declare extern_weak i8* @pthread_getspecific(i32)
258
259 declare extern_weak i32 @pthread_setspecific(i32, i8*)
260
261 declare extern_weak i32 @pthread_create(i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)
262
263 declare extern_weak i32 @pthread_cancel(i32)
264
265 declare extern_weak i32 @pthread_mutex_lock(%struct.pthread_mutex_t*)
266
267 declare extern_weak i32 @pthread_mutex_trylock(%struct.pthread_mutex_t*)
268
269 declare extern_weak i32 @pthread_mutex_unlock(%struct.pthread_mutex_t*)
270
271 declare extern_weak i32 @pthread_mutex_init(%struct.pthread_mutex_t*, %struct..0._11*)
272
273 declare extern_weak i32 @pthread_key_create(i32*, void (i8*)*)
274
275 declare extern_weak i32 @pthread_key_delete(i32)
276
277 declare extern_weak i32 @pthread_mutexattr_init(%struct..0._11*)
278
279 declare extern_weak i32 @pthread_mutexattr_settype(%struct..0._11*, i32)
280
281 declare extern_weak i32 @pthread_mutexattr_destroy(%struct..0._11*)
0 ; RUN: llvm-as < %s | llc -o - | %llvmgcc -xassembler -c -o /dev/null -
1 ; PR2609
2 %struct..0._11 = type { i32 }
3 %struct..1__pthread_mutex_s = type { i32, i32, i32, i32, i32, %struct..0._11 }
4 %struct.pthread_attr_t = type { i32, [32 x i8] }
5 %struct.pthread_mutex_t = type { %struct..1__pthread_mutex_s }
6 %"struct.std::__ctype_abstract_base" = type { %"struct.std::locale::facet" }
7 %"struct.std::basic_ios >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream >"*, i8, i8, %"struct.std::basic_streambuf >"*, %"struct.std::ctype"*, %"struct.std::__ctype_abstract_base"*, %"struct.std::__ctype_abstract_base"* }
8 %"struct.std::basic_istream >" = type { i32 (...)**, i32, %"struct.std::basic_ios >" }
9 %"struct.std::basic_istream >::sentry" = type { i8 }
10 %"struct.std::basic_ostream >" = type { i32 (...)**, %"struct.std::basic_ios >" }
11 %"struct.std::basic_streambuf >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %"struct.std::locale" }
12 %"struct.std::ctype" = type { %"struct.std::locale::facet", i32*, i8, i32*, i32*, i16*, i8, [256 x i8], [256 x i8], i8 }
13 %"struct.std::ios_base" = type { i32 (...)**, i32, i32, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, %"struct.std::ios_base::_Words"*, %"struct.std::locale" }
14 %"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 }
15 %"struct.std::ios_base::_Words" = type { i8*, i32 }
16 %"struct.std::locale" = type { %"struct.std::locale::_Impl"* }
17 %"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i32, %"struct.std::locale::facet"**, i8** }
18 %"struct.std::locale::facet" = type { i32 (...)**, i32 }
19
20 @_ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; [#uses=0]
21 @_ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; [#uses=0]
22 @_ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; [#uses=0]
23 @_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; [#uses=0]
24 @_ZL22__gthrw_pthread_cancelm = alias weak i32 (i32)* @pthread_cancel ; [#uses=0]
25 @_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; [#uses=0]
26 @_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; [#uses=0]
27 @_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; [#uses=0]
28 @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%struct.pthread_mutex_t*, %struct..0._11*)* @pthread_mutex_init ; [#uses=0]
29 @_ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; [#uses=0]
30 @_ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; [#uses=0]
31 @_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%struct..0._11*)* @pthread_mutexattr_init ; [#uses=0]
32 @_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%struct..0._11*, i32)* @pthread_mutexattr_settype ; [#uses=0]
33 @_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%struct..0._11*)* @pthread_mutexattr_destroy ; [#uses=0]
34
35 define %"struct.std::basic_istream >"* @_ZNSi7getlineEPcic(%"struct.std::basic_istream >"* %this, i8* %__s, i32 %__n, i8 signext %__delim) {
36 entry:
37 %__cerb = alloca %"struct.std::basic_istream >::sentry" ; <%"struct.std::basic_istream >::sentry"*> [#uses=2]
38 getelementptr %"struct.std::basic_istream >"* %this, i32 0, i32 1 ; :0 [#uses=7]
39 store i32 0, i32* %0, align 4
40 call void @_ZNSi6sentryC1ERSib( %"struct.std::basic_istream >::sentry"* %__cerb, %"struct.std::basic_istream >"* %this, i8 zeroext 1 )
41 getelementptr %"struct.std::basic_istream >::sentry"* %__cerb, i32 0, i32 0 ; :1 [#uses=1]
42 load i8* %1, align 8 ; :2 [#uses=1]
43 %toBool = icmp eq i8 %2, 0 ; [#uses=1]
44 br i1 %toBool, label %bb162, label %bb
45
46 bb: ; preds = %entry
47 zext i8 %__delim to i32 ; :3 [#uses=1]
48 getelementptr %"struct.std::basic_istream >"* %this, i32 0, i32 0 ; :4 [#uses=1]
49 load i32 (...)*** %4, align 4 ; :5 [#uses=1]
50 getelementptr i32 (...)** %5, i32 -3 ; :6 [#uses=1]
51 bitcast i32 (...)** %6 to i32* ; :7 [#uses=1]
52 load i32* %7, align 4 ; :8 [#uses=1]
53 bitcast %"struct.std::basic_istream >"* %this to i8* ; :9 [#uses=1]
54 %ctg2186 = getelementptr i8* %9, i32 %8 ; [#uses=1]
55 bitcast i8* %ctg2186 to %"struct.std::basic_ios >"* ; <%"struct.std::basic_ios >"*>:10 [#uses=1]
56 getelementptr %"struct.std::basic_ios >"* %10, i32 0, i32 4 ; <%"struct.std::basic_streambuf >"**>:11 [#uses=1]
57 load %"struct.std::basic_streambuf >"** %11, align 4 ; <%"struct.std::basic_streambuf >"*>:12 [#uses=9]
58 getelementptr %"struct.std::basic_streambuf >"* %12, i32 0, i32 2 ; :13 [#uses=10]
59 load i8** %13, align 4 ; :14 [#uses=2]
60 getelementptr %"struct.std::basic_streambuf >"* %12, i32 0, i32 3 ; :15 [#uses=6]
61 load i8** %15, align 4 ; :16 [#uses=1]
62 icmp ult i8* %14, %16 ; :17 [#uses=1]
63 br i1 %17, label %bb81, label %bb82
64
65 bb81: ; preds = %bb
66 load i8* %14, align 1 ; :18 [#uses=1]
67 zext i8 %18 to i32 ; :19 [#uses=1]
68 %.pre = getelementptr %"struct.std::basic_streambuf >"* %12, i32 0, i32 0 ; [#uses=1]
69 br label %bb119.preheader
70
71 bb82: ; preds = %bb
72 getelementptr %"struct.std::basic_streambuf >"* %12, i32 0, i32 0 ; :20 [#uses=2]
73 load i32 (...)*** %20, align 4 ; :21 [#uses=1]
74 getelementptr i32 (...)** %21, i32 9 ; :22 [#uses=1]
75 load i32 (...)** %22, align 4 ; :23 [#uses=1]
76 bitcast i32 (...)* %23 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:24 [#uses=1]
77 invoke i32 %24( %"struct.std::basic_streambuf >"* %12 )
78 to label %bb119.preheader unwind label %lpad ; :25 [#uses=1]
79
80 bb119.preheader: ; preds = %bb82, %bb81
81 %.pre-phi = phi i32 (...)*** [ %.pre, %bb81 ], [ %20, %bb82 ] ; [#uses=4]
82 %__c79.0.ph = phi i32 [ %19, %bb81 ], [ %25, %bb82 ] ; [#uses=1]
83 sext i8 %__delim to i32 ; :26 [#uses=1]
84 br label %bb119
85
86 bb84: ; preds = %bb119
87 sub i32 %__n, %82 ; :27 [#uses=1]
88 add i32 %27, -1 ; :28 [#uses=2]
89 load i8** %15, align 4 ; :29 [#uses=1]
90 ptrtoint i8* %29 to i32 ; :30 [#uses=1]
91 load i8** %13, align 4 ; :31 [#uses=3]
92 ptrtoint i8* %31 to i32 ; :32 [#uses=2]
93 sub i32 %30, %32 ; :33 [#uses=2]
94 icmp slt i32 %28, %33 ; :34 [#uses=1]
95 select i1 %34, i32 %28, i32 %33 ; :35 [#uses=3]
96 icmp sgt i32 %35, 1 ; :36 [#uses=1]
97 br i1 %36, label %bb90, label %bb99
98
99 bb90: ; preds = %bb84
100 call i8* @memchr( i8* %31, i32 %26, i32 %35 ) nounwind readonly ; :37 [#uses=2]
101 icmp eq i8* %37, null ; :38 [#uses=1]
102 br i1 %38, label %bb93, label %bb92
103
104 bb92: ; preds = %bb90
105 ptrtoint i8* %37 to i32 ; :39 [#uses=1]
106 sub i32 %39, %32 ; :40 [#uses=1]
107 br label %bb93
108
109 bb93: ; preds = %bb92, %bb90
110 %__size.0 = phi i32 [ %40, %bb92 ], [ %35, %bb90 ] ; [#uses=4]
111 call void @llvm.memcpy.i32( i8* %__s_addr.0, i8* %31, i32 %__size.0, i32 1 )
112 getelementptr i8* %__s_addr.0, i32 %__size.0 ; :41 [#uses=3]
113 load i8** %13, align 4 ; :42 [#uses=1]
114 getelementptr i8* %42, i32 %__size.0 ; :43 [#uses=1]
115 store i8* %43, i8** %13, align 4
116 load i32* %0, align 4 ; :44 [#uses=1]
117 add i32 %44, %__size.0 ; :45 [#uses=1]
118 store i32 %45, i32* %0, align 4
119 load i8** %13, align 4 ; :46 [#uses=2]
120 load i8** %15, align 4 ; :47 [#uses=1]
121 icmp ult i8* %46, %47 ; :48 [#uses=1]
122 br i1 %48, label %bb95, label %bb96
123
124 bb95: ; preds = %bb93
125 load i8* %46, align 1 ; :49 [#uses=1]
126 zext i8 %49 to i32 ; :50 [#uses=1]
127 br label %bb119
128
129 bb96: ; preds = %bb93
130 load i32 (...)*** %.pre-phi, align 4 ; :51 [#uses=1]
131 getelementptr i32 (...)** %51, i32 9 ; :52 [#uses=1]
132 load i32 (...)** %52, align 4 ; :53 [#uses=1]
133 bitcast i32 (...)* %53 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:54 [#uses=1]
134 invoke i32 %54( %"struct.std::basic_streambuf >"* %12 )
135 to label %bb119 unwind label %lpad ; :55 [#uses=1]
136
137 bb99: ; preds = %bb84
138 trunc i32 %__c79.0 to i8 ; :56 [#uses=1]
139 store i8 %56, i8* %__s_addr.0, align 1
140 getelementptr i8* %__s_addr.0, i32 1 ; :57 [#uses=5]
141 load i32* %0, align 4 ; :58 [#uses=1]
142 add i32 %58, 1 ; :59 [#uses=1]
143 store i32 %59, i32* %0, align 4
144 load i8** %13, align 4 ; :60 [#uses=3]
145 load i8** %15, align 4 ; :61 [#uses=1]
146 icmp ult i8* %60, %61 ; :62 [#uses=1]
147 br i1 %62, label %bb101, label %bb102
148
149 bb101: ; preds = %bb99
150 load i8* %60, align 1 ; :63 [#uses=1]
151 zext i8 %63 to i32 ; :64 [#uses=1]
152 getelementptr i8* %60, i32 1 ; :65 [#uses=1]
153 store i8* %65, i8** %13, align 4
154 br label %bb104
155
156 bb102: ; preds = %bb99
157 load i32 (...)*** %.pre-phi, align 4 ; :66 [#uses=1]
158 getelementptr i32 (...)** %66, i32 10 ; :67 [#uses=1]
159 load i32 (...)** %67, align 4 ; :68 [#uses=1]
160 bitcast i32 (...)* %68 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:69 [#uses=1]
161 invoke i32 %69( %"struct.std::basic_streambuf >"* %12 )
162 to label %bb104 unwind label %lpad ; :70 [#uses=1]
163
164 bb104: ; preds = %bb102, %bb101
165 %__ret44.0 = phi i32 [ %64, %bb101 ], [ %70, %bb102 ] ; [#uses=1]
166 icmp eq i32 %__ret44.0, -1 ; :71 [#uses=1]
167 br i1 %71, label %bb119, label %bb112
168
169 bb112: ; preds = %bb104
170 load i8** %13, align 4 ; :72 [#uses=2]
171 load i8** %15, align 4 ; :73 [#uses=1]
172 icmp ult i8* %72, %73 ; :74 [#uses=1]
173 br i1 %74, label %bb114, label %bb115
174
175 bb114: ; preds = %bb112
176 load i8* %72, align 1 ; :75 [#uses=1]
177 zext i8 %75 to i32 ; :76 [#uses=1]
178 br label %bb119
179
180 bb115: ; preds = %bb112
181 load i32 (...)*** %.pre-phi, align 4 ; :77 [#uses=1]
182 getelementptr i32 (...)** %77, i32 9 ; :78 [#uses=1]
183 load i32 (...)** %78, align 4 ; :79 [#uses=1]
184 bitcast i32 (...)* %79 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:80 [#uses=1]
185 invoke i32 %80( %"struct.std::basic_streambuf >"* %12 )
186 to label %bb119 unwind label %lpad ; :81 [#uses=1]
187
188 bb119: ; preds = %bb115, %bb114, %bb104, %bb96, %bb95, %bb119.preheader
189 %__c79.0 = phi i32 [ %__c79.0.ph, %bb119.preheader ], [ %50, %bb95 ], [ %76, %bb114 ], [ %55, %bb96 ], [ -1, %bb104 ], [ %81, %bb115 ] ; [#uses=3]
190 %__s_addr.0 = phi i8* [ %__s, %bb119.preheader ], [ %41, %bb95 ], [ %57, %bb114 ], [ %41, %bb96 ], [ %57, %bb104 ], [ %57, %bb115 ] ; [#uses=5]
191 load i32* %0, align 4 ; :82 [#uses=2]
192 add i32 %82, 1 ; :83 [#uses=2]
193 %.not = icmp sge i32 %83, %__n ; [#uses=1]
194 icmp eq i32 %__c79.0, -1 ; :84 [#uses=3]
195 icmp eq i32 %__c79.0, %3 ; :85 [#uses=2]
196 %or.cond = or i1 %84, %85 ; [#uses=1]
197 %or.cond188 = or i1 %or.cond, %.not ; [#uses=1]
198 br i1 %or.cond188, label %bb141, label %bb84
199
200 bb141: ; preds = %bb119
201 %.not194 = xor i1 %85, true ; [#uses=1]
202 %brmerge = or i1 %84, %.not194 ; [#uses=1]
203 %.mux = select i1 %84, i32 2, i32 4 ; [#uses=0]
204 br i1 %brmerge, label %bb162, label %bb146
205
206 bb146: ; preds = %bb141
207 store i32 %83, i32* %0, align 4
208 load i8** %13, align 4 ; :86 [#uses=2]
209 load i8** %15, align 4 ; :87 [#uses=1]
210 icmp ult i8* %86, %87 ; :88 [#uses=1]
211 br i1 %88, label %bb148, label %bb149
212
213 bb148: ; preds = %bb146
214 getelementptr i8* %86, i32 1 ; :89 [#uses=1]
215 store i8* %89, i8** %13, align 4
216 ret %"struct.std::basic_istream >"* %this
217
218 bb149: ; preds = %bb146
219 load i32 (...)*** %.pre-phi, align 4 ; :90 [#uses=1]
220 getelementptr i32 (...)** %90, i32 10 ; :91 [#uses=1]
221 load i32 (...)** %91, align 4 ; :92 [#uses=1]
222 bitcast i32 (...)* %92 to i32 (%"struct.std::basic_streambuf >"*)* ; >"*)*>:93 [#uses=1]
223 invoke i32 %93( %"struct.std::basic_streambuf >"* %12 )
224 to label %bb162 unwind label %lpad ; :94 [#uses=0]
225
226 bb162: ; preds = %bb149, %bb141, %entry
227 ret %"struct.std::basic_istream >"* %this
228
229 lpad: ; preds = %bb149, %bb115, %bb102, %bb96, %bb82
230 %__s_addr.1 = phi i8* [ %__s, %bb82 ], [ %__s_addr.0, %bb149 ], [ %41, %bb96 ], [ %57, %bb102 ], [ %57, %bb115 ] ; [#uses=0]
231 call void @__cxa_rethrow( ) noreturn
232 unreachable
233 }
234
235 declare i8* @__cxa_begin_catch(i8*) nounwind
236
237 declare i8* @llvm.eh.exception() nounwind
238
239 declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) nounwind
240
241 declare void @__cxa_rethrow() noreturn
242
243 declare void @__cxa_end_catch()
244
245 declare i32 @__gxx_personality_v0(...)
246
247 declare void @_ZNSi6sentryC1ERSib(%"struct.std::basic_istream >::sentry"*, %"struct.std::basic_istream >"*, i8 zeroext )
248
249 declare i8* @memchr(i8*, i32, i32) nounwind readonly
250
251 declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
252
253 declare void @_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate(%"struct.std::basic_ios >"*, i32)
254
255 declare extern_weak i32 @pthread_once(i32*, void ()*)
256
257 declare extern_weak i8* @pthread_getspecific(i32)
258
259 declare extern_weak i32 @pthread_setspecific(i32, i8*)
260
261 declare extern_weak i32 @pthread_create(i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)
262
263 declare extern_weak i32 @pthread_cancel(i32)
264
265 declare extern_weak i32 @pthread_mutex_lock(%struct.pthread_mutex_t*)
266
267 declare extern_weak i32 @pthread_mutex_trylock(%struct.pthread_mutex_t*)
268
269 declare extern_weak i32 @pthread_mutex_unlock(%struct.pthread_mutex_t*)
270
271 declare extern_weak i32 @pthread_mutex_init(%struct.pthread_mutex_t*, %struct..0._11*)
272
273 declare extern_weak i32 @pthread_key_create(i32*, void (i8*)*)
274
275 declare extern_weak i32 @pthread_key_delete(i32)
276
277 declare extern_weak i32 @pthread_mutexattr_init(%struct..0._11*)
278
279 declare extern_weak i32 @pthread_mutexattr_settype(%struct..0._11*, i32)
280
281 declare extern_weak i32 @pthread_mutexattr_destroy(%struct..0._11*)