1 ; Bitcode compatibility test for llvm 3.6.2
3 ; N.b: This is 3.6.2-compatible IR. The CHECK lines occasionally differ from
4 ; the IR used to generate the bitcode, and may need to be updated. These
5 ; locations are tagged with an 'XXX'.
7 ; RUN: llvm-dis < %s.bc | FileCheck %s
9 target datalayout = "E"
10 ; CHECK: target datalayout = "E"
12 target triple = "x86_64-apple-macosx10.10.0"
13 ; CHECK: target triple = "x86_64-apple-macosx10.10.0"
15 ;; Module-level assembly
16 module asm "beep boop"
17 ; CHECK: module asm "beep boop"
20 $comdat.any = comdat any
21 ; CHECK: $comdat.any = comdat any
22 $comdat.exactmatch = comdat exactmatch
23 ; CHECK: $comdat.exactmatch = comdat exactmatch
24 $comdat.largest = comdat largest
25 ; CHECK: $comdat.largest = comdat largest
26 $comdat.noduplicates = comdat nodeduplicate
27 ; CHECK: $comdat.noduplicates = comdat nodeduplicate
28 $comdat.samesize = comdat samesize
29 ; CHECK: $comdat.samesize = comdat samesize
31 ; Global Variables -- comdat
32 @comdat.any = global i32 0, comdat
33 ; CHECK: @comdat.any = global i32 0, comdat
34 @comdat.exactmatch = global i32 0, comdat
35 ; CHECK: @comdat.exactmatch = global i32 0, comdat
36 @comdat.largest = global i32 0, comdat
37 ; CHECK: @comdat.largest = global i32 0, comdat
38 @comdat.noduplicates = global i32 0, comdat
39 ; CHECK: @comdat.noduplicates = global i32 0, comdat
40 @comdat.samesize = global i32 0, comdat
41 ; CHECK: @comdat.samesize = global i32 0, comdat
43 ; Force two globals from different comdats into sections with the same name.
46 @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
47 ; CHECK: @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
48 @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
49 ; CHECK: @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
52 @const.true = constant i1 true
53 ; CHECK: @const.true = constant i1 true
54 @const.false = constant i1 false
55 ; CHECK: @const.false = constant i1 false
56 @const.int = constant i32 zeroinitializer
57 ; CHECK: @const.int = constant i32 0
58 @const.float = constant double 0.0
59 ; CHECK: @const.float = constant double 0.0
60 @const.null = constant i8* null
61 ; CHECK: @const.null = constant ptr null
62 %const.struct.type = type { i32, i8 }
63 %const.struct.type.packed = type <{ i32, i8 }>
64 @const.struct = constant %const.struct.type { i32 -1, i8 undef }
65 ; CHECK: @const.struct = constant %const.struct.type { i32 -1, i8 undef }
66 @const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }>
67 ; CHECK: @const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }>
68 @const.array = constant [2 x i32] [i32 -3, i32 -4]
69 ; CHECK: @const.array = constant [2 x i32] [i32 -3, i32 -4]
70 @const.vector = constant <2 x i32> <i32 -5, i32 -6>
71 ; CHECK: @const.vector = constant <2 x i32> <i32 -5, i32 -6>
74 ; Format: [@<GlobalVarName> =] [Linkage] [Visibility] [DLLStorageClass]
75 ; [ThreadLocal] [unnamed_addr] [AddrSpace] [ExternallyInitialized]
76 ; <global | constant> <Type> [<InitializerConstant>]
77 ; [, section "name"] [, align <Alignment>]
79 ; Global Variables -- Simple
81 ; CHECK: @g1 = global i32 0
83 ; CHECK: @g2 = constant i32 0
85 ; Global Variables -- Linkage
86 @g.private = private global i32 0
87 ; CHECK: @g.private = private global i32 0
88 @g.internal = internal global i32 0
89 ; CHECK: @g.internal = internal global i32 0
90 @g.available_externally = available_externally global i32 0
91 ; CHECK: @g.available_externally = available_externally global i32 0
92 @g.linkonce = linkonce global i32 0
93 ; CHECK: @g.linkonce = linkonce global i32 0
94 @g.weak = weak global i32 0
95 ; CHECK: @g.weak = weak global i32 0
96 @g.common = common global i32 0
97 ; CHECK: @g.common = common global i32 0
98 @g.appending = appending global [4 x i8] c"test"
99 ; CHECK: @g.appending = appending global [4 x i8] c"test"
100 @g.extern_weak = extern_weak global i32
101 ; CHECK: @g.extern_weak = extern_weak global i32
102 @g.linkonce_odr = linkonce_odr global i32 0
103 ; CHECK: @g.linkonce_odr = linkonce_odr global i32 0
104 @g.weak_odr = weak_odr global i32 0
105 ; CHECK: @g.weak_odr = weak_odr global i32 0
106 @g.external = external global i32
107 ; CHECK: @g.external = external global i32
109 ; Global Variables -- Visibility
110 @g.default = default global i32 0
111 ; CHECK: @g.default = global i32 0
112 @g.hidden = hidden global i32 0
113 ; CHECK: @g.hidden = hidden global i32 0
114 @g.protected = protected global i32 0
115 ; CHECK: @g.protected = protected global i32 0
117 ; Global Variables -- DLLStorageClass
118 @g.dlldefault = default global i32 0
119 ; CHECK: @g.dlldefault = global i32 0
120 @g.dllimport = external dllimport global i32
121 ; CHECK: @g.dllimport = external dllimport global i32
122 @g.dllexport = dllexport global i32 0
123 ; CHECK: @g.dllexport = dllexport global i32 0
125 ; Global Variables -- ThreadLocal
126 @g.notthreadlocal = global i32 0
127 ; CHECK: @g.notthreadlocal = global i32 0
128 @g.generaldynamic = thread_local global i32 0
129 ; CHECK: @g.generaldynamic = thread_local global i32 0
130 @g.localdynamic = thread_local(localdynamic) global i32 0
131 ; CHECK: @g.localdynamic = thread_local(localdynamic) global i32 0
132 @g.initialexec = thread_local(initialexec) global i32 0
133 ; CHECK: @g.initialexec = thread_local(initialexec) global i32 0
134 @g.localexec = thread_local(localexec) global i32 0
135 ; CHECK: @g.localexec = thread_local(localexec) global i32 0
137 ; Global Variables -- unnamed_addr
138 @g.unnamed_addr = unnamed_addr global i32 0
139 ; CHECK: @g.unnamed_addr = unnamed_addr global i32 0
141 ; Global Variables -- AddrSpace
142 @g.addrspace = addrspace(1) global i32 0
143 ; CHECK: @g.addrspace = addrspace(1) global i32 0
145 ; Global Variables -- ExternallyInitialized
146 @g.externally_initialized = external externally_initialized global i32
147 ; CHECK: @g.externally_initialized = external externally_initialized global i32
149 ; Global Variables -- section
150 @g.section = global i32 0, section "_DATA"
151 ; CHECK: @g.section = global i32 0, section "_DATA"
153 ; Global Variables -- align
154 @g.align = global i32 0, align 4
155 ; CHECK: @g.align = global i32 0, align 4
157 ; Global Variables -- Intrinsics
158 %pri.func.data = type { i32, void ()*, i8* }
159 @g.used1 = global i32 0
160 @g.used2 = global i32 0
161 @g.used3 = global i8 0
163 @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
164 ; CHECK: @llvm.used = appending global [1 x ptr] [ptr @g.used1], section "llvm.metadata"
165 @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
166 ; CHECK: @llvm.compiler.used = appending global [1 x ptr] [ptr @g.used2], section "llvm.metadata"
167 @llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
168 ; CHECK: @llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, ptr @g.f1, ptr @g.used3 }], section "llvm.metadata"
169 @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
170 ; CHECK: @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, ptr @g.f1, ptr @g.used3 }], section "llvm.metadata"
173 ; Format: @<Name> = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
174 ; [unnamed_addr] alias <AliaseeTy> @<Aliasee>
177 @a.private = private alias i32* @g.private
178 ; CHECK: @a.private = private alias i32, ptr @g.private
179 @a.internal = internal alias i32* @g.internal
180 ; CHECK: @a.internal = internal alias i32, ptr @g.internal
181 @a.linkonce = linkonce alias i32* @g.linkonce
182 ; CHECK: @a.linkonce = linkonce alias i32, ptr @g.linkonce
183 @a.weak = weak alias i32* @g.weak
184 ; CHECK: @a.weak = weak alias i32, ptr @g.weak
185 @a.linkonce_odr = linkonce_odr alias i32* @g.linkonce_odr
186 ; CHECK: @a.linkonce_odr = linkonce_odr alias i32, ptr @g.linkonce_odr
187 @a.weak_odr = weak_odr alias i32* @g.weak_odr
188 ; CHECK: @a.weak_odr = weak_odr alias i32, ptr @g.weak_odr
189 @a.external = external alias i32* @g1
190 ; CHECK: @a.external = alias i32, ptr @g1
192 ; Aliases -- Visibility
193 @a.default = default alias i32* @g.default
194 ; CHECK: @a.default = alias i32, ptr @g.default
195 @a.hidden = hidden alias i32* @g.hidden
196 ; CHECK: @a.hidden = hidden alias i32, ptr @g.hidden
197 @a.protected = protected alias i32* @g.protected
198 ; CHECK: @a.protected = protected alias i32, ptr @g.protected
200 ; Aliases -- DLLStorageClass
201 @a.dlldefault = default alias i32* @g.dlldefault
202 ; CHECK: @a.dlldefault = alias i32, ptr @g.dlldefault
203 @a.dllimport = dllimport alias i32* @g1
204 ; CHECK: @a.dllimport = dllimport alias i32, ptr @g1
205 @a.dllexport = dllexport alias i32* @g.dllexport
206 ; CHECK: @a.dllexport = dllexport alias i32, ptr @g.dllexport
208 ; Aliases -- ThreadLocal
209 @a.notthreadlocal = alias i32* @g.notthreadlocal
210 ; CHECK: @a.notthreadlocal = alias i32, ptr @g.notthreadlocal
211 @a.generaldynamic = thread_local alias i32* @g.generaldynamic
212 ; CHECK: @a.generaldynamic = thread_local alias i32, ptr @g.generaldynamic
213 @a.localdynamic = thread_local(localdynamic) alias i32* @g.localdynamic
214 ; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, ptr @g.localdynamic
215 @a.initialexec = thread_local(initialexec) alias i32* @g.initialexec
216 ; CHECK: @a.initialexec = thread_local(initialexec) alias i32, ptr @g.initialexec
217 @a.localexec = thread_local(localexec) alias i32* @g.localexec
218 ; CHECK: @a.localexec = thread_local(localexec) alias i32, ptr @g.localexec
220 ; Aliases -- unnamed_addr
221 @a.unnamed_addr = unnamed_addr alias i32* @g.unnamed_addr
222 ; CHECK: @a.unnamed_addr = unnamed_addr alias i32, ptr @g.unnamed_addr
225 ; Format: define [linkage] [visibility] [DLLStorageClass]
226 ; [cconv] [ret attrs]
227 ; <ResultType> @<FunctionName> ([argument list])
228 ; [unnamed_addr] [fn Attrs] [section "name"] [comdat [($name)]]
229 ; [align N] [gc] [prefix Constant]
232 ; Functions -- Simple
234 ; CHECK: declare void @f1()
237 ; CHECK: define void @f2()
242 ; Functions -- linkage
243 define private void @f.private() {
244 ; CHECK: define private void @f.private()
248 define internal void @f.internal() {
249 ; CHECK: define internal void @f.internal()
253 define available_externally void @f.available_externally() {
254 ; CHECK: define available_externally void @f.available_externally()
258 define linkonce void @f.linkonce() {
259 ; CHECK: define linkonce void @f.linkonce()
263 define weak void @f.weak() {
264 ; CHECK: define weak void @f.weak()
268 define linkonce_odr void @f.linkonce_odr() {
269 ; CHECK: define linkonce_odr void @f.linkonce_odr()
273 define weak_odr void @f.weak_odr() {
274 ; CHECK: define weak_odr void @f.weak_odr()
278 declare external void @f.external()
279 ; CHECK: declare void @f.external()
280 declare extern_weak void @f.extern_weak()
281 ; CHECK: declare extern_weak void @f.extern_weak()
283 ; Functions -- visibility
284 declare default void @f.default()
285 ; CHECK: declare void @f.default()
286 declare hidden void @f.hidden()
287 ; CHECK: declare hidden void @f.hidden()
288 declare protected void @f.protected()
289 ; CHECK: declare protected void @f.protected()
291 ; Functions -- DLLStorageClass
292 declare dllimport void @f.dllimport()
293 ; CHECK: declare dllimport void @f.dllimport()
294 declare dllexport void @f.dllexport()
295 ; CHECK: declare dllexport void @f.dllexport()
297 ; Functions -- cconv (Calling conventions)
298 declare ccc void @f.ccc()
299 ; CHECK: declare void @f.ccc()
300 declare fastcc void @f.fastcc()
301 ; CHECK: declare fastcc void @f.fastcc()
302 declare coldcc void @f.coldcc()
303 ; CHECK: declare coldcc void @f.coldcc()
304 declare cc10 void @f.cc10()
305 ; CHECK: declare ghccc void @f.cc10()
306 declare ghccc void @f.ghccc()
307 ; CHECK: declare ghccc void @f.ghccc()
308 declare cc11 void @f.cc11()
309 ; CHECK: declare cc11 void @f.cc11()
310 declare anyregcc void @f.anyregcc()
311 ; CHECK: declare anyregcc void @f.anyregcc()
312 declare preserve_mostcc void @f.preserve_mostcc()
313 ; CHECK: declare preserve_mostcc void @f.preserve_mostcc()
314 declare preserve_allcc void @f.preserve_allcc()
315 ; CHECK: declare preserve_allcc void @f.preserve_allcc()
316 declare cc64 void @f.cc64()
317 ; CHECK: declare x86_stdcallcc void @f.cc64()
318 declare x86_stdcallcc void @f.x86_stdcallcc()
319 ; CHECK: declare x86_stdcallcc void @f.x86_stdcallcc()
320 declare cc65 void @f.cc65()
321 ; CHECK: declare x86_fastcallcc void @f.cc65()
322 declare x86_fastcallcc void @f.x86_fastcallcc()
323 ; CHECK: declare x86_fastcallcc void @f.x86_fastcallcc()
324 declare cc66 void @f.cc66()
325 ; CHECK: declare arm_apcscc void @f.cc66()
326 declare arm_apcscc void @f.arm_apcscc()
327 ; CHECK: declare arm_apcscc void @f.arm_apcscc()
328 declare cc67 void @f.cc67()
329 ; CHECK: declare arm_aapcscc void @f.cc67()
330 declare arm_aapcscc void @f.arm_aapcscc()
331 ; CHECK: declare arm_aapcscc void @f.arm_aapcscc()
332 declare cc68 void @f.cc68()
333 ; CHECK: declare arm_aapcs_vfpcc void @f.cc68()
334 declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
335 ; CHECK: declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
336 declare cc69 void @f.cc69()
337 ; CHECK: declare msp430_intrcc void @f.cc69()
338 declare msp430_intrcc void @f.msp430_intrcc()
339 ; CHECK: declare msp430_intrcc void @f.msp430_intrcc()
340 declare cc70 void @f.cc70()
341 ; CHECK: declare x86_thiscallcc void @f.cc70()
342 declare x86_thiscallcc void @f.x86_thiscallcc()
343 ; CHECK: declare x86_thiscallcc void @f.x86_thiscallcc()
344 declare cc71 void @f.cc71()
345 ; CHECK: declare ptx_kernel void @f.cc71()
346 declare ptx_kernel void @f.ptx_kernel()
347 ; CHECK: declare ptx_kernel void @f.ptx_kernel()
348 declare cc72 void @f.cc72()
349 ; CHECK: declare ptx_device void @f.cc72()
350 declare ptx_device void @f.ptx_device()
351 ; CHECK: declare ptx_device void @f.ptx_device()
352 declare cc75 void @f.cc75()
353 ; CHECK: declare spir_func void @f.cc75()
354 declare spir_func void @f.spir_func()
355 ; CHECK: declare spir_func void @f.spir_func()
356 declare cc76 void @f.cc76()
357 ; CHECK: declare spir_kernel void @f.cc76()
358 declare spir_kernel void @f.spir_kernel()
359 ; CHECK: declare spir_kernel void @f.spir_kernel()
360 declare cc77 void @f.cc77()
361 ; CHECK: declare intel_ocl_bicc void @f.cc77()
362 declare intel_ocl_bicc void @f.intel_ocl_bicc()
363 ; CHECK: declare intel_ocl_bicc void @f.intel_ocl_bicc()
364 declare cc78 void @f.cc78()
365 ; CHECK: declare x86_64_sysvcc void @f.cc78()
366 declare x86_64_sysvcc void @f.x86_64_sysvcc()
367 ; CHECK: declare x86_64_sysvcc void @f.x86_64_sysvcc()
368 declare cc79 void @f.cc79()
369 ; CHECK: declare win64cc void @f.cc79()
370 declare win64cc void @f.x86_64_win64cc()
371 ; CHECK: declare win64cc void @f.x86_64_win64cc()
372 declare cc80 void @f.cc80()
373 ; CHECK: declare x86_vectorcallcc void @f.cc80()
374 declare x86_vectorcallcc void @f.x86_vectorcallcc()
375 ; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc()
376 declare cc1023 void @f.cc1023()
377 ; CHECK: declare cc1023 void @f.cc1023()
379 ; Functions -- ret attrs (Return attributes)
380 declare zeroext i64 @f.zeroext()
381 ; CHECK: declare zeroext i64 @f.zeroext()
382 declare signext i64 @f.signext()
383 ; CHECK: declare signext i64 @f.signext()
384 declare inreg i32* @f.inreg()
385 ; CHECK: declare inreg ptr @f.inreg()
386 declare noalias i32* @f.noalias()
387 ; CHECK: declare noalias ptr @f.noalias()
388 declare nonnull i32* @f.nonnull()
389 ; CHECK: declare nonnull ptr @f.nonnull()
390 declare dereferenceable(4) i32* @f.dereferenceable4()
391 ; CHECK: declare dereferenceable(4) ptr @f.dereferenceable4()
392 declare dereferenceable(8) i32* @f.dereferenceable8()
393 ; CHECK: declare dereferenceable(8) ptr @f.dereferenceable8()
394 declare dereferenceable(16) i32* @f.dereferenceable16()
395 ; CHECK: declare dereferenceable(16) ptr @f.dereferenceable16()
397 ; Functions -- Parameter attributes
398 declare void @f.param.zeroext(i8 zeroext)
399 ; CHECK: declare void @f.param.zeroext(i8 zeroext)
400 declare void @f.param.signext(i8 signext)
401 ; CHECK: declare void @f.param.signext(i8 signext)
402 declare void @f.param.inreg(i8 inreg)
403 ; CHECK: declare void @f.param.inreg(i8 inreg)
404 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
405 ; CHECK: declare void @f.param.byval(ptr byval({ i8, i8 }))
406 declare void @f.param.inalloca(i8* inalloca)
407 ; CHECK: declare void @f.param.inalloca(ptr inalloca(i8))
408 declare void @f.param.sret(i8* sret(i8))
409 ; CHECK: declare void @f.param.sret(ptr sret(i8))
410 declare void @f.param.noalias(i8* noalias)
411 ; CHECK: declare void @f.param.noalias(ptr noalias)
412 declare void @f.param.nocapture(i8* nocapture)
413 ; CHECK: declare void @f.param.nocapture(ptr nocapture)
414 declare void @f.param.nest(i8* nest)
415 ; CHECK: declare void @f.param.nest(ptr nest)
416 declare i8* @f.param.returned(i8* returned)
417 ; CHECK: declare ptr @f.param.returned(ptr returned)
418 declare void @f.param.nonnull(i8* nonnull)
419 ; CHECK: declare void @f.param.nonnull(ptr nonnull)
420 declare void @f.param.dereferenceable(i8* dereferenceable(4))
421 ; CHECK: declare void @f.param.dereferenceable(ptr dereferenceable(4))
423 ; Functions -- unnamed_addr
424 declare void @f.unnamed_addr() unnamed_addr
425 ; CHECK: declare void @f.unnamed_addr() unnamed_addr
427 ; Functions -- fn Attrs (Function attributes)
428 declare void @f.alignstack4() alignstack(4)
429 ; CHECK: declare void @f.alignstack4() #0
430 declare void @f.alignstack8() alignstack(8)
431 ; CHECK: declare void @f.alignstack8() #1
432 declare void @f.alwaysinline() alwaysinline
433 ; CHECK: declare void @f.alwaysinline() #2
434 declare void @f.cold() cold
435 ; CHECK: declare void @f.cold() #3
436 declare void @f.inlinehint() inlinehint
437 ; CHECK: declare void @f.inlinehint() #4
438 declare void @f.jumptable() unnamed_addr jumptable
439 ; CHECK: declare void @f.jumptable() unnamed_addr #5
440 declare void @f.minsize() minsize
441 ; CHECK: declare void @f.minsize() #6
442 declare void @f.naked() naked
443 ; CHECK: declare void @f.naked() #7
444 declare void @f.nobuiltin() nobuiltin
445 ; CHECK: declare void @f.nobuiltin() #8
446 declare void @f.noduplicate() noduplicate
447 ; CHECK: declare void @f.noduplicate() #9
448 declare void @f.noimplicitfloat() noimplicitfloat
449 ; CHECK: declare void @f.noimplicitfloat() #10
450 declare void @f.noinline() noinline
451 ; CHECK: declare void @f.noinline() #11
452 declare void @f.nonlazybind() nonlazybind
453 ; CHECK: declare void @f.nonlazybind() #12
454 declare void @f.noredzone() noredzone
455 ; CHECK: declare void @f.noredzone() #13
456 declare void @f.noreturn() noreturn
457 ; CHECK: declare void @f.noreturn() #14
458 declare void @f.nounwind() nounwind
459 ; CHECK: declare void @f.nounwind() #15
460 declare void @f.optnone() noinline optnone
461 ; CHECK: declare void @f.optnone() #16
462 declare void @f.optsize() optsize
463 ; CHECK: declare void @f.optsize() #17
464 declare void @f.readnone() readnone
465 ; CHECK: declare void @f.readnone() #18
466 declare void @f.readonly() readonly
467 ; CHECK: declare void @f.readonly() #19
468 declare void @f.returns_twice() returns_twice
469 ; CHECK: declare void @f.returns_twice() #20
470 declare void @f.sanitize_address() sanitize_address
471 ; CHECK: declare void @f.sanitize_address() #21
472 declare void @f.sanitize_memory() sanitize_memory
473 ; CHECK: declare void @f.sanitize_memory() #22
474 declare void @f.sanitize_thread() sanitize_thread
475 ; CHECK: declare void @f.sanitize_thread() #23
476 declare void @f.ssp() ssp
477 ; CHECK: declare void @f.ssp() #24
478 declare void @f.sspreq() sspreq
479 ; CHECK: declare void @f.sspreq() #25
480 declare void @f.sspstrong() sspstrong
481 ; CHECK: declare void @f.sspstrong() #26
482 declare void @f.uwtable() uwtable
483 ; CHECK: declare void @f.uwtable() #27
484 declare void @f.kvpair() "cpu"="cortex-a8"
485 ; CHECK:declare void @f.kvpair() #28
487 ; Functions -- section
488 declare void @f.section() section "80"
489 ; CHECK: declare void @f.section() section "80"
491 ; Functions -- comdat
492 define void @f.comdat_any() comdat($comdat.any) {
493 ; CHECK: define void @f.comdat_any() comdat($comdat.any)
497 define void @f.comdat_exactmatch() comdat($comdat.exactmatch) {
498 ; CHECK: define void @f.comdat_exactmatch() comdat($comdat.exactmatch)
502 define void @f.comdat_largest() comdat($comdat.largest) {
503 ; CHECK: define void @f.comdat_largest() comdat($comdat.largest)
507 define void @f.comdat_noduplicates() comdat($comdat.noduplicates) {
508 ; CHECK: define void @f.comdat_noduplicates() comdat($comdat.noduplicates)
512 define void @f.comdat_samesize() comdat($comdat.samesize) {
513 ; CHECK: define void @f.comdat_samesize() comdat($comdat.samesize)
519 declare void @f.align2() align 2
520 ; CHECK: declare void @f.align2() align 2
521 declare void @f.align4() align 4
522 ; CHECK: declare void @f.align4() align 4
523 declare void @f.align8() align 8
524 ; CHECK: declare void @f.align8() align 8
527 declare void @f.gcshadow() gc "shadow-stack"
528 ; CHECK: declare void @f.gcshadow() gc "shadow-stack"
530 ; Functions -- Prefix data
531 declare void @f.prefixi32() prefix i32 1684365668
532 ; CHECK: declare void @f.prefixi32() prefix i32 1684365668
533 declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
534 ; CHECK: declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
536 ;; Atomic Memory Ordering Constraints
537 define void @atomics(i32* %word) {
538 %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
539 ; CHECK: %cmpxchg.0 = cmpxchg ptr %word, i32 0, i32 4 monotonic monotonic
540 %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
541 ; CHECK: %cmpxchg.1 = cmpxchg ptr %word, i32 0, i32 5 acq_rel monotonic
542 %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
543 ; CHECK: %cmpxchg.2 = cmpxchg ptr %word, i32 0, i32 6 acquire monotonic
544 %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
545 ; CHECK: %cmpxchg.3 = cmpxchg ptr %word, i32 0, i32 7 release monotonic
546 %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
547 ; CHECK: %cmpxchg.4 = cmpxchg ptr %word, i32 0, i32 8 seq_cst monotonic
548 %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
549 ; CHECK: %cmpxchg.5 = cmpxchg weak ptr %word, i32 0, i32 9 seq_cst monotonic
550 %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
551 ; CHECK: %cmpxchg.6 = cmpxchg volatile ptr %word, i32 0, i32 10 seq_cst monotonic
552 %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
553 ; CHECK: %cmpxchg.7 = cmpxchg weak volatile ptr %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
554 %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
555 ; CHECK: %atomicrmw.xchg = atomicrmw xchg ptr %word, i32 12 monotonic
556 %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic
557 ; CHECK: %atomicrmw.add = atomicrmw add ptr %word, i32 13 monotonic
558 %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic
559 ; CHECK: %atomicrmw.sub = atomicrmw sub ptr %word, i32 14 monotonic
560 %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic
561 ; CHECK: %atomicrmw.and = atomicrmw and ptr %word, i32 15 monotonic
562 %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic
563 ; CHECK: %atomicrmw.nand = atomicrmw nand ptr %word, i32 16 monotonic
564 %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic
565 ; CHECK: %atomicrmw.or = atomicrmw or ptr %word, i32 17 monotonic
566 %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic
567 ; CHECK: %atomicrmw.xor = atomicrmw xor ptr %word, i32 18 monotonic
568 %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic
569 ; CHECK: %atomicrmw.max = atomicrmw max ptr %word, i32 19 monotonic
570 %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic
571 ; CHECK: %atomicrmw.min = atomicrmw volatile min ptr %word, i32 20 monotonic
572 %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic
573 ; CHECK: %atomicrmw.umax = atomicrmw umax ptr %word, i32 21 syncscope("singlethread") monotonic
574 %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic
575 ; CHECK: %atomicrmw.umin = atomicrmw volatile umin ptr %word, i32 22 syncscope("singlethread") monotonic
577 ; CHECK: fence acquire
579 ; CHECK: fence release
581 ; CHECK: fence acq_rel
582 fence syncscope("singlethread") seq_cst
583 ; CHECK: fence syncscope("singlethread") seq_cst
585 ; XXX: The parser spits out the load type here.
586 %ld.1 = load atomic i32* %word monotonic, align 4
587 ; CHECK: %ld.1 = load atomic i32, ptr %word monotonic, align 4
588 %ld.2 = load atomic volatile i32* %word acquire, align 8
589 ; CHECK: %ld.2 = load atomic volatile i32, ptr %word acquire, align 8
590 %ld.3 = load atomic volatile i32* %word syncscope("singlethread") seq_cst, align 16
591 ; CHECK: %ld.3 = load atomic volatile i32, ptr %word syncscope("singlethread") seq_cst, align 16
593 store atomic i32 23, i32* %word monotonic, align 4
594 ; CHECK: store atomic i32 23, ptr %word monotonic, align 4
595 store atomic volatile i32 24, i32* %word monotonic, align 4
596 ; CHECK: store atomic volatile i32 24, ptr %word monotonic, align 4
597 store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4
598 ; CHECK: store atomic volatile i32 25, ptr %word syncscope("singlethread") monotonic, align 4
603 define void @fastmathflags(float %op1, float %op2) {
604 %f.nnan = fadd nnan float %op1, %op2
605 ; CHECK: %f.nnan = fadd nnan float %op1, %op2
606 %f.ninf = fadd ninf float %op1, %op2
607 ; CHECK: %f.ninf = fadd ninf float %op1, %op2
608 %f.nsz = fadd nsz float %op1, %op2
609 ; CHECK: %f.nsz = fadd nsz float %op1, %op2
610 %f.arcp = fadd arcp float %op1, %op2
611 ; CHECK: %f.arcp = fadd arcp float %op1, %op2
612 %f.fast = fadd fast float %op1, %op2
613 ; CHECK: %f.fast = fadd fast float %op1, %op2
618 %opaquety = type opaque
619 define void @typesystem() {
620 %p0 = bitcast i8* null to i32 (i32)*
621 ; CHECK: %p0 = bitcast ptr null to ptr
622 %p1 = bitcast i8* null to void (i8*)*
623 ; CHECK: %p1 = bitcast ptr null to ptr
624 %p2 = bitcast i8* null to i32 (i8*, ...)*
625 ; CHECK: %p2 = bitcast ptr null to ptr
626 %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
627 ; CHECK: %p3 = bitcast ptr null to ptr
628 %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
629 ; CHECK: %p4 = bitcast ptr null to ptr
630 %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
631 ; CHECK: %p5 = bitcast ptr null to ptr
633 %t0 = alloca i1942652
634 ; CHECK: %t0 = alloca i1942652
636 ; CHECK: %t1 = alloca half
638 ; CHECK: %t2 = alloca float
640 ; CHECK: %t3 = alloca double
642 ; CHECK: %t4 = alloca fp128
643 %t5 = alloca x86_fp80
644 ; CHECK: %t5 = alloca x86_fp80
645 %t6 = alloca ppc_fp128
646 ; CHECK: %t6 = alloca ppc_fp128
648 ; CHECK: %t7 = alloca x86_mmx
649 %t8 = alloca %opaquety*
650 ; CHECK: %t8 = alloca ptr
655 ;; Inline Assembler Expressions
656 define void @inlineasm(i32 %arg) {
657 call i32 asm "bswap $0", "=r,r"(i32 %arg)
658 ; CHECK: call i32 asm "bswap $0", "=r,r"(i32 %arg)
659 call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
660 ; CHECK: call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
666 ; Instructions -- Terminators
667 define void @instructions.terminators(i8 %val) { ; XXX: landingpad changed.
668 ; CHECK: define void @instructions.terminators(i8 %val) personality ptr @personality_handler
670 br i1 false, label %iftrue, label %iffalse
671 ; CHECK: br i1 false, label %iftrue, label %iffalse
673 ; CHECK: br label %iftrue
679 switch i8 %val, label %defaultdest [
680 ; CHECK: switch i8 %val, label %defaultdest [
681 i8 0, label %defaultdest.0
682 ; CHECK: i8 0, label %defaultdest.0
683 i8 1, label %defaultdest.1
684 ; CHECK: i8 1, label %defaultdest.1
685 i8 2, label %defaultdest.2
686 ; CHECK: i8 2, label %defaultdest.2
697 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
698 ; CHECK: indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
699 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
700 ; CHECK: indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
702 invoke fastcc void @f.fastcc()
703 ; CHECK: invoke fastcc void @f.fastcc()
704 to label %defaultdest unwind label %exc
705 ; CHECK: to label %defaultdest unwind label %exc
707 %cleanup = landingpad i32 personality i32()* @personality_handler cleanup
710 ; CHECK: resume i32 undef
717 ; Instructions -- Binary Operations
718 define void @instructions.binops(i8 %op1, i8 %op2) {
721 ; CHECK: add i8 %op1, %op2
722 add nuw i8 %op1, %op2
723 ; CHECK: add nuw i8 %op1, %op2
724 add nsw i8 %op1, %op2
725 ; CHECK: add nsw i8 %op1, %op2
726 add nuw nsw i8 %op1, %op2
727 ; CHECK: add nuw nsw i8 %op1, %op2
729 ; CHECK: sub i8 %op1, %op2
730 sub nuw i8 %op1, %op2
731 ; CHECK: sub nuw i8 %op1, %op2
732 sub nsw i8 %op1, %op2
733 ; CHECK: sub nsw i8 %op1, %op2
734 sub nuw nsw i8 %op1, %op2
735 ; CHECK: sub nuw nsw i8 %op1, %op2
737 ; CHECK: mul i8 %op1, %op2
738 mul nuw i8 %op1, %op2
739 ; CHECK: mul nuw i8 %op1, %op2
740 mul nsw i8 %op1, %op2
741 ; CHECK: mul nsw i8 %op1, %op2
742 mul nuw nsw i8 %op1, %op2
743 ; CHECK: mul nuw nsw i8 %op1, %op2
747 ; CHECK: udiv i8 %op1, %op2
748 udiv exact i8 %op1, %op2
749 ; CHECK: udiv exact i8 %op1, %op2
751 ; CHECK: sdiv i8 %op1, %op2
752 sdiv exact i8 %op1, %op2
753 ; CHECK: sdiv exact i8 %op1, %op2
757 ; CHECK: urem i8 %op1, %op2
759 ; CHECK: srem i8 %op1, %op2
764 ; Instructions -- Bitwise Binary Operations
765 define void @instructions.bitwise_binops(i8 %op1, i8 %op2) {
768 ; CHECK: shl i8 %op1, %op2
769 shl nuw i8 %op1, %op2
770 ; CHECK: shl nuw i8 %op1, %op2
771 shl nsw i8 %op1, %op2
772 ; CHECK: shl nsw i8 %op1, %op2
773 shl nuw nsw i8 %op1, %op2
774 ; CHECK: shl nuw nsw i8 %op1, %op2
778 ; CHECK: lshr i8 %op1, %op2
779 lshr exact i8 %op1, %op2
780 ; CHECK: lshr exact i8 %op1, %op2
782 ; CHECK: ashr i8 %op1, %op2
783 ashr exact i8 %op1, %op2
784 ; CHECK: ashr exact i8 %op1, %op2
788 ; CHECK: and i8 %op1, %op2
790 ; CHECK: or i8 %op1, %op2
792 ; CHECK: xor i8 %op1, %op2
797 ; Instructions -- Vector Operations
798 define void @instructions.vectorops(<4 x float> %vec, <4 x float> %vec2) {
799 extractelement <4 x float> %vec, i8 0
800 ; CHECK: extractelement <4 x float> %vec, i8 0
801 insertelement <4 x float> %vec, float 3.500000e+00, i8 0
802 ; CHECK: insertelement <4 x float> %vec, float 3.500000e+00, i8 0
803 shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
804 ; CHECK: shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
809 ; Instructions -- Aggregate Operations
810 define void @instructions.aggregateops({ i8, i32 } %up, <{ i8, i32 }> %p,
811 [3 x i8] %arr, { i8, { i32 }} %n,
812 <2 x i8*> %pvec, <2 x i64> %offsets) {
813 extractvalue { i8, i32 } %up, 0
814 ; CHECK: extractvalue { i8, i32 } %up, 0
815 extractvalue <{ i8, i32 }> %p, 1
816 ; CHECK: extractvalue <{ i8, i32 }> %p, 1
817 extractvalue [3 x i8] %arr, 2
818 ; CHECK: extractvalue [3 x i8] %arr, 2
819 extractvalue { i8, { i32 } } %n, 1, 0
820 ; CHECK: extractvalue { i8, { i32 } } %n, 1, 0
822 insertvalue { i8, i32 } %up, i8 1, 0
823 ; CHECK: insertvalue { i8, i32 } %up, i8 1, 0
824 insertvalue <{ i8, i32 }> %p, i32 2, 1
825 ; CHECK: insertvalue <{ i8, i32 }> %p, i32 2, 1
826 insertvalue [3 x i8] %arr, i8 0, 0
827 ; CHECK: insertvalue [3 x i8] %arr, i8 0, 0
828 insertvalue { i8, { i32 } } %n, i32 0, 1, 0
829 ; CHECK: insertvalue { i8, { i32 } } %n, i32 0, 1, 0
831 %up.ptr = alloca { i8, i32 }
832 %p.ptr = alloca <{ i8, i32 }>
833 %arr.ptr = alloca [3 x i8]
834 %n.ptr = alloca { i8, { i32 } }
836 ; XXX: The parser spits out the load type here.
837 getelementptr { i8, i32 }* %up.ptr, i8 0
838 ; CHECK: getelementptr { i8, i32 }, ptr %up.ptr, i8 0
839 getelementptr <{ i8, i32 }>* %p.ptr, i8 1
840 ; CHECK: getelementptr <{ i8, i32 }>, ptr %p.ptr, i8 1
841 getelementptr [3 x i8]* %arr.ptr, i8 2
842 ; CHECK: getelementptr [3 x i8], ptr %arr.ptr, i8 2
843 getelementptr { i8, { i32 } }* %n.ptr, i32 0, i32 1
844 ; CHECK: getelementptr { i8, { i32 } }, ptr %n.ptr, i32 0, i32 1
845 getelementptr inbounds { i8, { i32 } }* %n.ptr, i32 1, i32 0
846 ; CHECK: getelementptr inbounds { i8, { i32 } }, ptr %n.ptr, i32 1, i32 0
847 getelementptr <2 x i8*> %pvec, <2 x i64> %offsets
848 ; CHECK: getelementptr i8, <2 x ptr> %pvec, <2 x i64> %offsets
853 ; Instructions -- Memory Access and Addressing Operations
857 define void @instructions.memops(i32** %base) {
858 alloca i32, i8 4, align 4
859 ; CHECK: alloca i32, i8 4, align 4
860 alloca inalloca i32, i8 4, align 4
861 ; CHECK: alloca inalloca i32, i8 4, align 4
863 load i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9
864 ; CHECK: load ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9
865 load volatile i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9
866 ; CHECK: load volatile ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9
868 store i32* null, i32** %base, align 4, !nontemporal !8
869 ; CHECK: store ptr null, ptr %base, align 4, !nontemporal !8
870 store volatile i32* null, i32** %base, align 4, !nontemporal !8
871 ; CHECK: store volatile ptr null, ptr %base, align 4, !nontemporal !8
876 ; Instructions -- Conversion Operations
877 define void @instructions.conversions() {
879 ; CHECK: trunc i32 -1 to i1
881 ; CHECK: zext i32 -1 to i64
883 ; CHECK: sext i32 -1 to i64
884 fptrunc float undef to half
885 ; CHECK: fptrunc float undef to half
886 fpext half undef to float
887 ; CHECK: fpext half undef to float
888 fptoui float undef to i32
889 ; CHECK: fptoui float undef to i32
890 fptosi float undef to i32
891 ; CHECK: fptosi float undef to i32
892 uitofp i32 1 to float
893 ; CHECK: uitofp i32 1 to float
894 sitofp i32 -1 to float
895 ; CHECK: sitofp i32 -1 to float
896 ptrtoint i8* null to i64
897 ; CHECK: ptrtoint ptr null to i64
898 inttoptr i64 0 to i8*
899 ; CHECK: inttoptr i64 0 to ptr
901 ; CHECK: bitcast i32 0 to i32
902 addrspacecast i32* null to i32 addrspace(1)*
903 ; CHECK: addrspacecast ptr null to ptr addrspace(1)
908 ; Instructions -- Other Operations
909 define void @instructions.other(i32 %op1, i32 %op2, half %fop1, half %fop2) {
911 icmp eq i32 %op1, %op2
912 ; CHECK: icmp eq i32 %op1, %op2
913 icmp ne i32 %op1, %op2
914 ; CHECK: icmp ne i32 %op1, %op2
915 icmp ugt i32 %op1, %op2
916 ; CHECK: icmp ugt i32 %op1, %op2
917 icmp uge i32 %op1, %op2
918 ; CHECK: icmp uge i32 %op1, %op2
919 icmp ult i32 %op1, %op2
920 ; CHECK: icmp ult i32 %op1, %op2
921 icmp ule i32 %op1, %op2
922 ; CHECK: icmp ule i32 %op1, %op2
923 icmp sgt i32 %op1, %op2
924 ; CHECK: icmp sgt i32 %op1, %op2
925 icmp sge i32 %op1, %op2
926 ; CHECK: icmp sge i32 %op1, %op2
927 icmp slt i32 %op1, %op2
928 ; CHECK: icmp slt i32 %op1, %op2
929 icmp sle i32 %op1, %op2
930 ; CHECK: icmp sle i32 %op1, %op2
932 fcmp false half %fop1, %fop2
933 ; CHECK: fcmp false half %fop1, %fop2
934 fcmp oeq half %fop1, %fop2
935 ; CHECK: fcmp oeq half %fop1, %fop2
936 fcmp ogt half %fop1, %fop2
937 ; CHECK: fcmp ogt half %fop1, %fop2
938 fcmp oge half %fop1, %fop2
939 ; CHECK: fcmp oge half %fop1, %fop2
940 fcmp olt half %fop1, %fop2
941 ; CHECK: fcmp olt half %fop1, %fop2
942 fcmp ole half %fop1, %fop2
943 ; CHECK: fcmp ole half %fop1, %fop2
944 fcmp one half %fop1, %fop2
945 ; CHECK: fcmp one half %fop1, %fop2
946 fcmp ord half %fop1, %fop2
947 ; CHECK: fcmp ord half %fop1, %fop2
948 fcmp ueq half %fop1, %fop2
949 ; CHECK: fcmp ueq half %fop1, %fop2
950 fcmp ugt half %fop1, %fop2
951 ; CHECK: fcmp ugt half %fop1, %fop2
952 fcmp uge half %fop1, %fop2
953 ; CHECK: fcmp uge half %fop1, %fop2
954 fcmp ult half %fop1, %fop2
955 ; CHECK: fcmp ult half %fop1, %fop2
956 fcmp ule half %fop1, %fop2
957 ; CHECK: fcmp ule half %fop1, %fop2
958 fcmp une half %fop1, %fop2
959 ; CHECK: fcmp une half %fop1, %fop2
960 fcmp uno half %fop1, %fop2
961 ; CHECK: fcmp uno half %fop1, %fop2
962 fcmp true half %fop1, %fop2
963 ; CHECK: fcmp true half %fop1, %fop2
967 %v1 = add i32 %op1, %op2
970 %v2 = add i32 %op1, %op2
973 phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
974 ; CHECK: phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
976 select i1 true, i32 0, i32 1
977 ; CHECK: select i1 true, i32 0, i32 1
978 select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
979 ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
981 call void @f.nobuiltin() builtin
982 ; CHECK: call void @f.nobuiltin() #36
984 call fastcc noalias i32* @f.noalias() noinline
985 ; CHECK: call fastcc noalias ptr @f.noalias() #11
986 tail call ghccc nonnull i32* @f.nonnull() minsize
987 ; CHECK: tail call ghccc nonnull ptr @f.nonnull() #6
992 define void @instructions.call_musttail(i8* inalloca %val) {
993 musttail call void @f.param.inalloca(i8* inalloca %val)
994 ; CHECK: musttail call void @f.param.inalloca(ptr inalloca(i8) %val)
999 declare void @llvm.donothing() nounwind readnone
1001 declare i32 @personality_handler()
1003 define void @instructions.landingpad() {
1004 ; CHECK: define void @instructions.landingpad() personality ptr @personality_handler
1006 invoke void @llvm.donothing() to label %proceed unwind label %catch1
1007 invoke void @llvm.donothing() to label %proceed unwind label %catch2
1008 invoke void @llvm.donothing() to label %proceed unwind label %catch3
1009 invoke void @llvm.donothing() to label %proceed unwind label %catch4
1013 ; CHECK: landingpad i32
1014 personality i32()* @personality_handler
1021 ; CHECK: landingpad i32
1022 personality i32()* @personality_handler
1026 ; CHECK: catch ptr null
1031 ; CHECK: landingpad i32
1032 personality i32()* @personality_handler
1036 ; CHECK: catch ptr null
1038 ; CHECK: catch ptr null
1043 ; CHECK: landingpad i32
1044 personality i32()* @personality_handler
1045 filter [2 x i32] zeroinitializer
1046 ; CHECK: filter [2 x i32] zeroinitializer
1053 ;; Intrinsic Functions
1055 ; Intrinsic Functions -- Variable Argument Handling
1056 declare void @llvm.va_start(i8*)
1057 declare void @llvm.va_copy(i8*, i8*)
1058 declare void @llvm.va_end(i8*)
1059 define void @instructions.va_arg(i8* %v, ...) {
1061 %ap2 = bitcast i8** %ap to i8*
1063 call void @llvm.va_start(i8* %ap2)
1064 ; CHECK: call void @llvm.va_start.p0(ptr %ap2)
1066 va_arg i8* %ap2, i32
1067 ; CHECK: va_arg ptr %ap2, i32
1069 call void @llvm.va_copy(i8* %v, i8* %ap2)
1070 ; CHECK: call void @llvm.va_copy.p0(ptr %v, ptr %ap2)
1072 call void @llvm.va_end(i8* %ap2)
1073 ; CHECK: call void @llvm.va_end.p0(ptr %ap2)
1078 ; Intrinsic Functions -- Accurate Garbage Collection
1079 declare void @llvm.gcroot(i8**, i8*)
1080 declare i8* @llvm.gcread(i8*, i8**)
1081 declare void @llvm.gcwrite(i8*, i8*, i8**)
1082 define void @intrinsics.gc() gc "shadow-stack" {
1083 %ptrloc = alloca i8*
1084 call void @llvm.gcroot(i8** %ptrloc, i8* null)
1085 ; CHECK: call void @llvm.gcroot(ptr %ptrloc, ptr null)
1087 call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1088 ; CHECK: call ptr @llvm.gcread(ptr null, ptr %ptrloc)
1091 call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1092 ; CHECK: call void @llvm.gcwrite(ptr %ref, ptr null, ptr %ptrloc)
1097 ; Intrinsic Functions -- Code Generation
1098 declare i8* @llvm.returnaddress(i32)
1099 declare i8* @llvm.frameaddress(i32)
1100 declare i32 @llvm.read_register.i32(metadata)
1101 declare i64 @llvm.read_register.i64(metadata)
1102 declare void @llvm.write_register.i32(metadata, i32)
1103 declare void @llvm.write_register.i64(metadata, i64)
1104 declare i8* @llvm.stacksave()
1105 declare void @llvm.stackrestore(i8*)
1106 declare void @llvm.prefetch(i8*, i32, i32, i32)
1107 declare void @llvm.pcmarker(i32)
1108 declare i64 @llvm.readcyclecounter()
1109 declare void @llvm.clear_cache(i8*, i8*)
1110 declare void @llvm.instrprof_increment(i8*, i64, i32, i32)
1113 define void @intrinsics.codegen() {
1114 call i8* @llvm.returnaddress(i32 1)
1115 ; CHECK: call ptr @llvm.returnaddress(i32 1)
1116 call i8* @llvm.frameaddress(i32 1)
1117 ; CHECK: call ptr @llvm.frameaddress.p0(i32 1)
1119 call i32 @llvm.read_register.i32(metadata !10)
1120 ; CHECK: call i32 @llvm.read_register.i32(metadata !10)
1121 call i64 @llvm.read_register.i64(metadata !10)
1122 ; CHECK: call i64 @llvm.read_register.i64(metadata !10)
1123 call void @llvm.write_register.i32(metadata !10, i32 0)
1124 ; CHECK: call void @llvm.write_register.i32(metadata !10, i32 0)
1125 call void @llvm.write_register.i64(metadata !10, i64 0)
1126 ; CHECK: call void @llvm.write_register.i64(metadata !10, i64 0)
1128 %stack = call i8* @llvm.stacksave()
1129 ; CHECK: %stack = call ptr @llvm.stacksave.p0()
1130 call void @llvm.stackrestore(i8* %stack)
1131 ; CHECK: call void @llvm.stackrestore.p0(ptr %stack)
1133 call void @llvm.prefetch(i8* %stack, i32 0, i32 3, i32 0)
1134 ; CHECK: call void @llvm.prefetch.p0(ptr %stack, i32 0, i32 3, i32 0)
1136 call void @llvm.pcmarker(i32 1)
1137 ; CHECK: call void @llvm.pcmarker(i32 1)
1139 call i64 @llvm.readcyclecounter()
1140 ; CHECK: call i64 @llvm.readcyclecounter()
1142 call void @llvm.clear_cache(i8* null, i8* null)
1143 ; CHECK: call void @llvm.clear_cache(ptr null, ptr null)
1145 call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1146 ; CHECK: call void @llvm.instrprof_increment(ptr null, i64 0, i32 0, i32 0)
1151 ; CHECK: attributes #0 = { alignstack=4 }
1152 ; CHECK: attributes #1 = { alignstack=8 }
1153 ; CHECK: attributes #2 = { alwaysinline }
1154 ; CHECK: attributes #3 = { cold }
1155 ; CHECK: attributes #4 = { inlinehint }
1156 ; CHECK: attributes #5 = { jumptable }
1157 ; CHECK: attributes #6 = { minsize }
1158 ; CHECK: attributes #7 = { naked }
1159 ; CHECK: attributes #8 = { nobuiltin }
1160 ; CHECK: attributes #9 = { noduplicate }
1161 ; CHECK: attributes #10 = { noimplicitfloat }
1162 ; CHECK: attributes #11 = { noinline }
1163 ; CHECK: attributes #12 = { nonlazybind }
1164 ; CHECK: attributes #13 = { noredzone }
1165 ; CHECK: attributes #14 = { noreturn }
1166 ; CHECK: attributes #15 = { nounwind }
1167 ; CHECK: attributes #16 = { noinline optnone }
1168 ; CHECK: attributes #17 = { optsize }
1169 ; CHECK: attributes #18 = { memory(none) }
1170 ; CHECK: attributes #19 = { memory(read) }
1171 ; CHECK: attributes #20 = { returns_twice }
1172 ; CHECK: attributes #21 = { sanitize_address }
1173 ; CHECK: attributes #22 = { sanitize_memory }
1174 ; CHECK: attributes #23 = { sanitize_thread }
1175 ; CHECK: attributes #24 = { ssp }
1176 ; CHECK: attributes #25 = { sspreq }
1177 ; CHECK: attributes #26 = { sspstrong }
1178 ; CHECK: attributes #27 = { uwtable }
1179 ; CHECK: attributes #28 = { "cpu"="cortex-a8" }
1180 ; CHECK: attributes #29 = { nocallback nofree nosync nounwind willreturn memory(none) }
1181 ; CHECK: attributes #30 = { nounwind memory(argmem: read) }
1182 ; CHECK: attributes #31 = { nounwind memory(argmem: readwrite) }
1183 ; CHECK: attributes #32 = { nocallback nofree nosync nounwind willreturn memory(read) }
1184 ; CHECK: attributes #33 = { nocallback nounwind }
1185 ; CHECK: attributes #34 = { nocallback nofree nosync nounwind willreturn }
1186 ; CHECK: attributes #35 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
1187 ; CHECK: attributes #36 = { builtin }
1191 ; Metadata -- Module flags
1192 !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1193 ; CHECK: !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1195 !0 = !{i32 1, !"mod1", i32 0}
1196 ; CHECK: !0 = !{i32 1, !"mod1", i32 0}
1197 !1 = !{i32 2, !"mod2", i32 0}
1198 ; CHECK: !1 = !{i32 2, !"mod2", i32 0}
1199 !2 = !{i32 3, !"mod3", !3}
1200 ; CHECK: !2 = !{i32 3, !"mod3", !3}
1202 ; CHECK: !3 = !{!"mod6", !0}
1203 !4 = !{i32 4, !"mod4", i32 0}
1204 ; CHECK: !4 = !{i32 4, !"mod4", i32 0}
1205 !5 = !{i32 5, !"mod5", !0}
1206 ; CHECK: !5 = !{i32 5, !"mod5", !0}
1207 !6 = !{i32 6, !"mod6", !0}
1208 ; CHECK: !6 = !{i32 6, !"mod6", !0}