1 ; Bitcode compatibility test for llvm 3.7.0
3 ; N.b: This is 3.7-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
32 @const.true = constant i1 true
33 ; CHECK: @const.true = constant i1 true
34 @const.false = constant i1 false
35 ; CHECK: @const.false = constant i1 false
36 @const.int = constant i32 zeroinitializer
37 ; CHECK: @const.int = constant i32 0
38 @const.float = constant double 0.0
39 ; CHECK: @const.float = constant double 0.0
40 @const.null = constant i8* null
41 ; CHECK: @const.null = constant ptr null
42 %const.struct.type = type { i32, i8 }
43 %const.struct.type.packed = type <{ i32, i8 }>
44 @const.struct = constant %const.struct.type { i32 -1, i8 undef }
45 ; CHECK: @const.struct = constant %const.struct.type { i32 -1, i8 undef }
46 @const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }>
47 ; CHECK: @const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }>
48 @const.array = constant [2 x i32] [i32 -3, i32 -4]
49 ; CHECK: @const.array = constant [2 x i32] [i32 -3, i32 -4]
50 @const.vector = constant <2 x i32> <i32 -5, i32 -6>
51 ; CHECK: @const.vector = constant <2 x i32> <i32 -5, i32 -6>
54 ; Format: [@<GlobalVarName> =] [Linkage] [Visibility] [DLLStorageClass]
55 ; [ThreadLocal] [unnamed_addr] [AddrSpace] [ExternallyInitialized]
56 ; <global | constant> <Type> [<InitializerConstant>]
57 ; [, section "name"] [, comdat [($name)]] [, align <Alignment>]
59 ; Global Variables -- Simple
61 ; CHECK: @g1 = global i32 0
63 ; CHECK: @g2 = constant i32 0
65 ; Global Variables -- Linkage
66 @g.private = private global i32 0
67 ; CHECK: @g.private = private global i32 0
68 @g.internal = internal global i32 0
69 ; CHECK: @g.internal = internal global i32 0
70 @g.available_externally = available_externally global i32 0
71 ; CHECK: @g.available_externally = available_externally global i32 0
72 @g.linkonce = linkonce global i32 0
73 ; CHECK: @g.linkonce = linkonce global i32 0
74 @g.weak = weak global i32 0
75 ; CHECK: @g.weak = weak global i32 0
76 @g.common = common global i32 0
77 ; CHECK: @g.common = common global i32 0
78 @g.appending = appending global [4 x i8] c"test"
79 ; CHECK: @g.appending = appending global [4 x i8] c"test"
80 @g.extern_weak = extern_weak global i32
81 ; CHECK: @g.extern_weak = extern_weak global i32
82 @g.linkonce_odr = linkonce_odr global i32 0
83 ; CHECK: @g.linkonce_odr = linkonce_odr global i32 0
84 @g.weak_odr = weak_odr global i32 0
85 ; CHECK: @g.weak_odr = weak_odr global i32 0
86 @g.external = external global i32
87 ; CHECK: @g.external = external global i32
89 ; Global Variables -- Visibility
90 @g.default = default global i32 0
91 ; CHECK: @g.default = global i32 0
92 @g.hidden = hidden global i32 0
93 ; CHECK: @g.hidden = hidden global i32 0
94 @g.protected = protected global i32 0
95 ; CHECK: @g.protected = protected global i32 0
97 ; Global Variables -- DLLStorageClass
98 @g.dlldefault = default global i32 0
99 ; CHECK: @g.dlldefault = global i32 0
100 @g.dllimport = external dllimport global i32
101 ; CHECK: @g.dllimport = external dllimport global i32
102 @g.dllexport = dllexport global i32 0
103 ; CHECK: @g.dllexport = dllexport global i32 0
105 ; Global Variables -- ThreadLocal
106 @g.notthreadlocal = global i32 0
107 ; CHECK: @g.notthreadlocal = global i32 0
108 @g.generaldynamic = thread_local global i32 0
109 ; CHECK: @g.generaldynamic = thread_local global i32 0
110 @g.localdynamic = thread_local(localdynamic) global i32 0
111 ; CHECK: @g.localdynamic = thread_local(localdynamic) global i32 0
112 @g.initialexec = thread_local(initialexec) global i32 0
113 ; CHECK: @g.initialexec = thread_local(initialexec) global i32 0
114 @g.localexec = thread_local(localexec) global i32 0
115 ; CHECK: @g.localexec = thread_local(localexec) global i32 0
117 ; Global Variables -- unnamed_addr
118 @g.unnamed_addr = unnamed_addr global i32 0
119 ; CHECK: @g.unnamed_addr = unnamed_addr global i32 0
121 ; Global Variables -- AddrSpace
122 @g.addrspace = addrspace(1) global i32 0
123 ; CHECK: @g.addrspace = addrspace(1) global i32 0
125 ; Global Variables -- ExternallyInitialized
126 @g.externally_initialized = external externally_initialized global i32
127 ; CHECK: @g.externally_initialized = external externally_initialized global i32
129 ; Global Variables -- section
130 @g.section = global i32 0, section "_DATA"
131 ; CHECK: @g.section = global i32 0, section "_DATA"
133 ; Global Variables -- comdat
134 @comdat.any = global i32 0, comdat
135 ; CHECK: @comdat.any = global i32 0, comdat
136 @comdat.exactmatch = global i32 0, comdat
137 ; CHECK: @comdat.exactmatch = global i32 0, comdat
138 @comdat.largest = global i32 0, comdat
139 ; CHECK: @comdat.largest = global i32 0, comdat
140 @comdat.noduplicates = global i32 0, comdat
141 ; CHECK: @comdat.noduplicates = global i32 0, comdat
142 @comdat.samesize = global i32 0, comdat
143 ; CHECK: @comdat.samesize = global i32 0, comdat
145 ; Force two globals from different comdats into sections with the same name.
146 $comdat1 = comdat any
147 $comdat2 = comdat any
148 @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
149 ; CHECK: @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
150 @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
151 ; CHECK: @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
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] [prologue Constant]
230 ; [personality 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()
396 declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
397 ; CHECK: declare dereferenceable_or_null(4) ptr @f.dereferenceable4_or_null()
398 declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
399 ; CHECK: declare dereferenceable_or_null(8) ptr @f.dereferenceable8_or_null()
400 declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
401 ; CHECK: declare dereferenceable_or_null(16) ptr @f.dereferenceable16_or_null()
403 ; Functions -- Parameter attributes
404 declare void @f.param.zeroext(i8 zeroext)
405 ; CHECK: declare void @f.param.zeroext(i8 zeroext)
406 declare void @f.param.signext(i8 signext)
407 ; CHECK: declare void @f.param.signext(i8 signext)
408 declare void @f.param.inreg(i8 inreg)
409 ; CHECK: declare void @f.param.inreg(i8 inreg)
410 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
411 ; CHECK: declare void @f.param.byval(ptr byval({ i8, i8 }))
412 declare void @f.param.inalloca(i8* inalloca)
413 ; CHECK: declare void @f.param.inalloca(ptr inalloca(i8))
414 declare void @f.param.sret(i8* sret(i8))
415 ; CHECK: declare void @f.param.sret(ptr sret(i8))
416 declare void @f.param.noalias(i8* noalias)
417 ; CHECK: declare void @f.param.noalias(ptr noalias)
418 declare void @f.param.nocapture(i8* nocapture)
419 ; CHECK: declare void @f.param.nocapture(ptr nocapture)
420 declare void @f.param.nest(i8* nest)
421 ; CHECK: declare void @f.param.nest(ptr nest)
422 declare i8* @f.param.returned(i8* returned)
423 ; CHECK: declare ptr @f.param.returned(ptr returned)
424 declare void @f.param.nonnull(i8* nonnull)
425 ; CHECK: declare void @f.param.nonnull(ptr nonnull)
426 declare void @f.param.dereferenceable(i8* dereferenceable(4))
427 ; CHECK: declare void @f.param.dereferenceable(ptr dereferenceable(4))
428 declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
429 ; CHECK: declare void @f.param.dereferenceable_or_null(ptr dereferenceable_or_null(4))
431 ; Functions -- unnamed_addr
432 declare void @f.unnamed_addr() unnamed_addr
433 ; CHECK: declare void @f.unnamed_addr() unnamed_addr
435 ; Functions -- fn Attrs (Function attributes)
436 declare void @f.alignstack4() alignstack(4)
437 ; CHECK: declare void @f.alignstack4() #0
438 declare void @f.alignstack8() alignstack(8)
439 ; CHECK: declare void @f.alignstack8() #1
440 declare void @f.alwaysinline() alwaysinline
441 ; CHECK: declare void @f.alwaysinline() #2
442 declare void @f.cold() cold
443 ; CHECK: declare void @f.cold() #3
444 declare void @f.convergent() convergent
445 ; CHECK: declare void @f.convergent() #4
446 declare void @f.inlinehint() inlinehint
447 ; CHECK: declare void @f.inlinehint() #5
448 declare void @f.jumptable() unnamed_addr jumptable
449 ; CHECK: declare void @f.jumptable() unnamed_addr #6
450 declare void @f.minsize() minsize
451 ; CHECK: declare void @f.minsize() #7
452 declare void @f.naked() naked
453 ; CHECK: declare void @f.naked() #8
454 declare void @f.nobuiltin() nobuiltin
455 ; CHECK: declare void @f.nobuiltin() #9
456 declare void @f.noduplicate() noduplicate
457 ; CHECK: declare void @f.noduplicate() #10
458 declare void @f.noimplicitfloat() noimplicitfloat
459 ; CHECK: declare void @f.noimplicitfloat() #11
460 declare void @f.noinline() noinline
461 ; CHECK: declare void @f.noinline() #12
462 declare void @f.nonlazybind() nonlazybind
463 ; CHECK: declare void @f.nonlazybind() #13
464 declare void @f.noredzone() noredzone
465 ; CHECK: declare void @f.noredzone() #14
466 declare void @f.noreturn() noreturn
467 ; CHECK: declare void @f.noreturn() #15
468 declare void @f.nounwind() nounwind
469 ; CHECK: declare void @f.nounwind() #16
470 declare void @f.optnone() noinline optnone
471 ; CHECK: declare void @f.optnone() #17
472 declare void @f.optsize() optsize
473 ; CHECK: declare void @f.optsize() #18
474 declare void @f.readnone() readnone
475 ; CHECK: declare void @f.readnone() #19
476 declare void @f.readonly() readonly
477 ; CHECK: declare void @f.readonly() #20
478 declare void @f.returns_twice() returns_twice
479 ; CHECK: declare void @f.returns_twice() #21
480 declare void @f.safestack() safestack
481 ; CHECK: declare void @f.safestack() #22
482 declare void @f.sanitize_address() sanitize_address
483 ; CHECK: declare void @f.sanitize_address() #23
484 declare void @f.sanitize_memory() sanitize_memory
485 ; CHECK: declare void @f.sanitize_memory() #24
486 declare void @f.sanitize_thread() sanitize_thread
487 ; CHECK: declare void @f.sanitize_thread() #25
488 declare void @f.ssp() ssp
489 ; CHECK: declare void @f.ssp() #26
490 declare void @f.sspreq() sspreq
491 ; CHECK: declare void @f.sspreq() #27
492 declare void @f.sspstrong() sspstrong
493 ; CHECK: declare void @f.sspstrong() #28
494 declare void @f.thunk() "thunk"
495 ; CHECK: declare void @f.thunk() #29
496 declare void @f.uwtable() uwtable
497 ; CHECK: declare void @f.uwtable() #30
498 declare void @f.kvpair() "cpu"="cortex-a8"
499 ; CHECK:declare void @f.kvpair() #31
501 ; Functions -- section
502 declare void @f.section() section "80"
503 ; CHECK: declare void @f.section() section "80"
505 ; Functions -- comdat
506 define void @f.comdat_any() comdat($comdat.any) {
507 ; CHECK: define void @f.comdat_any() comdat($comdat.any)
511 define void @f.comdat_exactmatch() comdat($comdat.exactmatch) {
512 ; CHECK: define void @f.comdat_exactmatch() comdat($comdat.exactmatch)
516 define void @f.comdat_largest() comdat($comdat.largest) {
517 ; CHECK: define void @f.comdat_largest() comdat($comdat.largest)
521 define void @f.comdat_noduplicates() comdat($comdat.noduplicates) {
522 ; CHECK: define void @f.comdat_noduplicates() comdat($comdat.noduplicates)
526 define void @f.comdat_samesize() comdat($comdat.samesize) {
527 ; CHECK: define void @f.comdat_samesize() comdat($comdat.samesize)
533 declare void @f.align2() align 2
534 ; CHECK: declare void @f.align2() align 2
535 declare void @f.align4() align 4
536 ; CHECK: declare void @f.align4() align 4
537 declare void @f.align8() align 8
538 ; CHECK: declare void @f.align8() align 8
541 declare void @f.gcshadow() gc "shadow-stack"
542 ; CHECK: declare void @f.gcshadow() gc "shadow-stack"
544 ; Functions -- Prefix data
545 declare void @f.prefixi32() prefix i32 1684365668
546 ; CHECK: declare void @f.prefixi32() prefix i32 1684365668
547 declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
548 ; CHECK: declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
550 ; Functions -- Prologue data
551 declare void @f.prologuei32() prologue i32 1684365669
552 ; CHECK: declare void @f.prologuei32() prologue i32 1684365669
553 declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
554 ; CHECK: declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
556 ; Functions -- Personality constant
557 declare void @llvm.donothing() nounwind readnone
558 ; CHECK: declare void @llvm.donothing() #32
559 define void @f.no_personality() personality i8 3 {
560 ; CHECK: define void @f.no_personality() personality i8 3
561 invoke void @llvm.donothing() to label %normal unwind label %exception
563 %cleanup = landingpad i8 cleanup
569 declare i32 @f.personality_handler()
570 ; CHECK: declare i32 @f.personality_handler()
571 define void @f.personality() personality i32 ()* @f.personality_handler {
572 ; CHECK: define void @f.personality() personality ptr @f.personality_handler
573 invoke void @llvm.donothing() to label %normal unwind label %exception
575 %cleanup = landingpad i32 cleanup
581 ;; Atomic Memory Ordering Constraints
582 define void @atomics(i32* %word) {
583 %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
584 ; CHECK: %cmpxchg.0 = cmpxchg ptr %word, i32 0, i32 4 monotonic monotonic
585 %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
586 ; CHECK: %cmpxchg.1 = cmpxchg ptr %word, i32 0, i32 5 acq_rel monotonic
587 %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
588 ; CHECK: %cmpxchg.2 = cmpxchg ptr %word, i32 0, i32 6 acquire monotonic
589 %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
590 ; CHECK: %cmpxchg.3 = cmpxchg ptr %word, i32 0, i32 7 release monotonic
591 %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
592 ; CHECK: %cmpxchg.4 = cmpxchg ptr %word, i32 0, i32 8 seq_cst monotonic
593 %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
594 ; CHECK: %cmpxchg.5 = cmpxchg weak ptr %word, i32 0, i32 9 seq_cst monotonic
595 %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
596 ; CHECK: %cmpxchg.6 = cmpxchg volatile ptr %word, i32 0, i32 10 seq_cst monotonic
597 %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
598 ; CHECK: %cmpxchg.7 = cmpxchg weak volatile ptr %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
599 %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
600 ; CHECK: %atomicrmw.xchg = atomicrmw xchg ptr %word, i32 12 monotonic
601 %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic
602 ; CHECK: %atomicrmw.add = atomicrmw add ptr %word, i32 13 monotonic
603 %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic
604 ; CHECK: %atomicrmw.sub = atomicrmw sub ptr %word, i32 14 monotonic
605 %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic
606 ; CHECK: %atomicrmw.and = atomicrmw and ptr %word, i32 15 monotonic
607 %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic
608 ; CHECK: %atomicrmw.nand = atomicrmw nand ptr %word, i32 16 monotonic
609 %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic
610 ; CHECK: %atomicrmw.or = atomicrmw or ptr %word, i32 17 monotonic
611 %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic
612 ; CHECK: %atomicrmw.xor = atomicrmw xor ptr %word, i32 18 monotonic
613 %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic
614 ; CHECK: %atomicrmw.max = atomicrmw max ptr %word, i32 19 monotonic
615 %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic
616 ; CHECK: %atomicrmw.min = atomicrmw volatile min ptr %word, i32 20 monotonic
617 %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic
618 ; CHECK: %atomicrmw.umax = atomicrmw umax ptr %word, i32 21 syncscope("singlethread") monotonic
619 %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic
620 ; CHECK: %atomicrmw.umin = atomicrmw volatile umin ptr %word, i32 22 syncscope("singlethread") monotonic
622 ; CHECK: fence acquire
624 ; CHECK: fence release
626 ; CHECK: fence acq_rel
627 fence syncscope("singlethread") seq_cst
628 ; CHECK: fence syncscope("singlethread") seq_cst
630 %ld.1 = load atomic i32, i32* %word monotonic, align 4
631 ; CHECK: %ld.1 = load atomic i32, ptr %word monotonic, align 4
632 %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
633 ; CHECK: %ld.2 = load atomic volatile i32, ptr %word acquire, align 8
634 %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16
635 ; CHECK: %ld.3 = load atomic volatile i32, ptr %word syncscope("singlethread") seq_cst, align 16
637 store atomic i32 23, i32* %word monotonic, align 4
638 ; CHECK: store atomic i32 23, ptr %word monotonic, align 4
639 store atomic volatile i32 24, i32* %word monotonic, align 4
640 ; CHECK: store atomic volatile i32 24, ptr %word monotonic, align 4
641 store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4
642 ; CHECK: store atomic volatile i32 25, ptr %word syncscope("singlethread") monotonic, align 4
647 define void @fastmathflags(float %op1, float %op2) {
648 %f.nnan = fadd nnan float %op1, %op2
649 ; CHECK: %f.nnan = fadd nnan float %op1, %op2
650 %f.ninf = fadd ninf float %op1, %op2
651 ; CHECK: %f.ninf = fadd ninf float %op1, %op2
652 %f.nsz = fadd nsz float %op1, %op2
653 ; CHECK: %f.nsz = fadd nsz float %op1, %op2
654 %f.arcp = fadd arcp float %op1, %op2
655 ; CHECK: %f.arcp = fadd arcp float %op1, %op2
656 %f.fast = fadd fast float %op1, %op2
657 ; CHECK: %f.fast = fadd fast float %op1, %op2
662 %opaquety = type opaque
663 define void @typesystem() {
664 %p0 = bitcast i8* null to i32 (i32)*
665 ; CHECK: %p0 = bitcast ptr null to ptr
666 %p1 = bitcast i8* null to void (i8*)*
667 ; CHECK: %p1 = bitcast ptr null to ptr
668 %p2 = bitcast i8* null to i32 (i8*, ...)*
669 ; CHECK: %p2 = bitcast ptr null to ptr
670 %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
671 ; CHECK: %p3 = bitcast ptr null to ptr
672 %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
673 ; CHECK: %p4 = bitcast ptr null to ptr
674 %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
675 ; CHECK: %p5 = bitcast ptr null to ptr
677 %t0 = alloca i1942652
678 ; CHECK: %t0 = alloca i1942652
680 ; CHECK: %t1 = alloca half
682 ; CHECK: %t2 = alloca float
684 ; CHECK: %t3 = alloca double
686 ; CHECK: %t4 = alloca fp128
687 %t5 = alloca x86_fp80
688 ; CHECK: %t5 = alloca x86_fp80
689 %t6 = alloca ppc_fp128
690 ; CHECK: %t6 = alloca ppc_fp128
692 ; CHECK: %t7 = alloca x86_mmx
693 %t8 = alloca %opaquety*
694 ; CHECK: %t8 = alloca ptr
699 ;; Inline Assembler Expressions
700 define void @inlineasm(i32 %arg) {
701 call i32 asm "bswap $0", "=r,r"(i32 %arg)
702 ; CHECK: call i32 asm "bswap $0", "=r,r"(i32 %arg)
703 call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
704 ; CHECK: call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
710 ; Instructions -- Terminators
711 define void @instructions.terminators(i8 %val) personality i32 -10 {
712 br i1 false, label %iftrue, label %iffalse
713 ; CHECK: br i1 false, label %iftrue, label %iffalse
715 ; CHECK: br label %iftrue
721 switch i8 %val, label %defaultdest [
722 ; CHECK: switch i8 %val, label %defaultdest [
723 i8 0, label %defaultdest.0
724 ; CHECK: i8 0, label %defaultdest.0
725 i8 1, label %defaultdest.1
726 ; CHECK: i8 1, label %defaultdest.1
727 i8 2, label %defaultdest.2
728 ; CHECK: i8 2, label %defaultdest.2
739 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
740 ; CHECK: indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
741 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
742 ; CHECK: indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
744 invoke fastcc void @f.fastcc()
745 ; CHECK: invoke fastcc void @f.fastcc()
746 to label %defaultdest unwind label %exc
747 ; CHECK: to label %defaultdest unwind label %exc
749 %cleanup = landingpad i32 cleanup
752 ; CHECK: resume i32 undef
759 ; Instructions -- Binary Operations
760 define void @instructions.binops(i8 %op1, i8 %op2) {
763 ; CHECK: add i8 %op1, %op2
764 add nuw i8 %op1, %op2
765 ; CHECK: add nuw i8 %op1, %op2
766 add nsw i8 %op1, %op2
767 ; CHECK: add nsw i8 %op1, %op2
768 add nuw nsw i8 %op1, %op2
769 ; CHECK: add nuw nsw i8 %op1, %op2
771 ; CHECK: sub i8 %op1, %op2
772 sub nuw i8 %op1, %op2
773 ; CHECK: sub nuw i8 %op1, %op2
774 sub nsw i8 %op1, %op2
775 ; CHECK: sub nsw i8 %op1, %op2
776 sub nuw nsw i8 %op1, %op2
777 ; CHECK: sub nuw nsw i8 %op1, %op2
779 ; CHECK: mul i8 %op1, %op2
780 mul nuw i8 %op1, %op2
781 ; CHECK: mul nuw i8 %op1, %op2
782 mul nsw i8 %op1, %op2
783 ; CHECK: mul nsw i8 %op1, %op2
784 mul nuw nsw i8 %op1, %op2
785 ; CHECK: mul nuw nsw i8 %op1, %op2
789 ; CHECK: udiv i8 %op1, %op2
790 udiv exact i8 %op1, %op2
791 ; CHECK: udiv exact i8 %op1, %op2
793 ; CHECK: sdiv i8 %op1, %op2
794 sdiv exact i8 %op1, %op2
795 ; CHECK: sdiv exact i8 %op1, %op2
799 ; CHECK: urem i8 %op1, %op2
801 ; CHECK: srem i8 %op1, %op2
806 ; Instructions -- Bitwise Binary Operations
807 define void @instructions.bitwise_binops(i8 %op1, i8 %op2) {
810 ; CHECK: shl i8 %op1, %op2
811 shl nuw i8 %op1, %op2
812 ; CHECK: shl nuw i8 %op1, %op2
813 shl nsw i8 %op1, %op2
814 ; CHECK: shl nsw i8 %op1, %op2
815 shl nuw nsw i8 %op1, %op2
816 ; CHECK: shl nuw nsw i8 %op1, %op2
820 ; CHECK: lshr i8 %op1, %op2
821 lshr exact i8 %op1, %op2
822 ; CHECK: lshr exact i8 %op1, %op2
824 ; CHECK: ashr i8 %op1, %op2
825 ashr exact i8 %op1, %op2
826 ; CHECK: ashr exact i8 %op1, %op2
830 ; CHECK: and i8 %op1, %op2
832 ; CHECK: or i8 %op1, %op2
834 ; CHECK: xor i8 %op1, %op2
839 ; Instructions -- Vector Operations
840 define void @instructions.vectorops(<4 x float> %vec, <4 x float> %vec2) {
841 extractelement <4 x float> %vec, i8 0
842 ; CHECK: extractelement <4 x float> %vec, i8 0
843 insertelement <4 x float> %vec, float 3.500000e+00, i8 0
844 ; CHECK: insertelement <4 x float> %vec, float 3.500000e+00, i8 0
845 shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
846 ; CHECK: shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
851 ; Instructions -- Aggregate Operations
852 define void @instructions.aggregateops({ i8, i32 } %up, <{ i8, i32 }> %p,
853 [3 x i8] %arr, { i8, { i32 }} %n,
854 <2 x i8*> %pvec, <2 x i64> %offsets) {
855 extractvalue { i8, i32 } %up, 0
856 ; CHECK: extractvalue { i8, i32 } %up, 0
857 extractvalue <{ i8, i32 }> %p, 1
858 ; CHECK: extractvalue <{ i8, i32 }> %p, 1
859 extractvalue [3 x i8] %arr, 2
860 ; CHECK: extractvalue [3 x i8] %arr, 2
861 extractvalue { i8, { i32 } } %n, 1, 0
862 ; CHECK: extractvalue { i8, { i32 } } %n, 1, 0
864 insertvalue { i8, i32 } %up, i8 1, 0
865 ; CHECK: insertvalue { i8, i32 } %up, i8 1, 0
866 insertvalue <{ i8, i32 }> %p, i32 2, 1
867 ; CHECK: insertvalue <{ i8, i32 }> %p, i32 2, 1
868 insertvalue [3 x i8] %arr, i8 0, 0
869 ; CHECK: insertvalue [3 x i8] %arr, i8 0, 0
870 insertvalue { i8, { i32 } } %n, i32 0, 1, 0
871 ; CHECK: insertvalue { i8, { i32 } } %n, i32 0, 1, 0
873 %up.ptr = alloca { i8, i32 }
874 %p.ptr = alloca <{ i8, i32 }>
875 %arr.ptr = alloca [3 x i8]
876 %n.ptr = alloca { i8, { i32 } }
878 getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
879 ; CHECK: getelementptr { i8, i32 }, ptr %up.ptr, i8 0
880 getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
881 ; CHECK: getelementptr <{ i8, i32 }>, ptr %p.ptr, i8 1
882 getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
883 ; CHECK: getelementptr [3 x i8], ptr %arr.ptr, i8 2
884 getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
885 ; CHECK: getelementptr { i8, { i32 } }, ptr %n.ptr, i32 0, i32 1
886 getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
887 ; CHECK: getelementptr inbounds { i8, { i32 } }, ptr %n.ptr, i32 1, i32 0
888 getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
889 ; CHECK: getelementptr i8, <2 x ptr> %pvec, <2 x i64> %offsets
894 ; Instructions -- Memory Access and Addressing Operations
898 define void @instructions.memops(i32** %base) {
899 alloca i32, i8 4, align 4
900 ; CHECK: alloca i32, i8 4, align 4
901 alloca inalloca i32, i8 4, align 4
902 ; CHECK: alloca inalloca i32, i8 4, align 4
904 load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
905 ; CHECK: load ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
906 load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
907 ; CHECK: load volatile ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
909 store i32* null, i32** %base, align 4, !nontemporal !8
910 ; CHECK: store ptr null, ptr %base, align 4, !nontemporal !8
911 store volatile i32* null, i32** %base, align 4, !nontemporal !8
912 ; CHECK: store volatile ptr null, ptr %base, align 4, !nontemporal !8
917 ; Instructions -- Conversion Operations
918 define void @instructions.conversions() {
920 ; CHECK: trunc i32 -1 to i1
922 ; CHECK: zext i32 -1 to i64
924 ; CHECK: sext i32 -1 to i64
925 fptrunc float undef to half
926 ; CHECK: fptrunc float undef to half
927 fpext half undef to float
928 ; CHECK: fpext half undef to float
929 fptoui float undef to i32
930 ; CHECK: fptoui float undef to i32
931 fptosi float undef to i32
932 ; CHECK: fptosi float undef to i32
933 uitofp i32 1 to float
934 ; CHECK: uitofp i32 1 to float
935 sitofp i32 -1 to float
936 ; CHECK: sitofp i32 -1 to float
937 ptrtoint i8* null to i64
938 ; CHECK: ptrtoint ptr null to i64
939 inttoptr i64 0 to i8*
940 ; CHECK: inttoptr i64 0 to ptr
942 ; CHECK: bitcast i32 0 to i32
943 addrspacecast i32* null to i32 addrspace(1)*
944 ; CHECK: addrspacecast ptr null to ptr addrspace(1)
949 ; Instructions -- Other Operations
950 define void @instructions.other(i32 %op1, i32 %op2, half %fop1, half %fop2) {
952 icmp eq i32 %op1, %op2
953 ; CHECK: icmp eq i32 %op1, %op2
954 icmp ne i32 %op1, %op2
955 ; CHECK: icmp ne i32 %op1, %op2
956 icmp ugt i32 %op1, %op2
957 ; CHECK: icmp ugt i32 %op1, %op2
958 icmp uge i32 %op1, %op2
959 ; CHECK: icmp uge i32 %op1, %op2
960 icmp ult i32 %op1, %op2
961 ; CHECK: icmp ult i32 %op1, %op2
962 icmp ule i32 %op1, %op2
963 ; CHECK: icmp ule i32 %op1, %op2
964 icmp sgt i32 %op1, %op2
965 ; CHECK: icmp sgt i32 %op1, %op2
966 icmp sge i32 %op1, %op2
967 ; CHECK: icmp sge i32 %op1, %op2
968 icmp slt i32 %op1, %op2
969 ; CHECK: icmp slt i32 %op1, %op2
970 icmp sle i32 %op1, %op2
971 ; CHECK: icmp sle i32 %op1, %op2
973 fcmp false half %fop1, %fop2
974 ; CHECK: fcmp false half %fop1, %fop2
975 fcmp oeq half %fop1, %fop2
976 ; CHECK: fcmp oeq half %fop1, %fop2
977 fcmp ogt half %fop1, %fop2
978 ; CHECK: fcmp ogt half %fop1, %fop2
979 fcmp oge half %fop1, %fop2
980 ; CHECK: fcmp oge half %fop1, %fop2
981 fcmp olt half %fop1, %fop2
982 ; CHECK: fcmp olt half %fop1, %fop2
983 fcmp ole half %fop1, %fop2
984 ; CHECK: fcmp ole half %fop1, %fop2
985 fcmp one half %fop1, %fop2
986 ; CHECK: fcmp one half %fop1, %fop2
987 fcmp ord half %fop1, %fop2
988 ; CHECK: fcmp ord half %fop1, %fop2
989 fcmp ueq half %fop1, %fop2
990 ; CHECK: fcmp ueq half %fop1, %fop2
991 fcmp ugt half %fop1, %fop2
992 ; CHECK: fcmp ugt half %fop1, %fop2
993 fcmp uge half %fop1, %fop2
994 ; CHECK: fcmp uge half %fop1, %fop2
995 fcmp ult half %fop1, %fop2
996 ; CHECK: fcmp ult half %fop1, %fop2
997 fcmp ule half %fop1, %fop2
998 ; CHECK: fcmp ule half %fop1, %fop2
999 fcmp une half %fop1, %fop2
1000 ; CHECK: fcmp une half %fop1, %fop2
1001 fcmp uno half %fop1, %fop2
1002 ; CHECK: fcmp uno half %fop1, %fop2
1003 fcmp true half %fop1, %fop2
1004 ; CHECK: fcmp true half %fop1, %fop2
1008 %v1 = add i32 %op1, %op2
1011 %v2 = add i32 %op1, %op2
1014 phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1015 ; CHECK: phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1017 select i1 true, i32 0, i32 1
1018 ; CHECK: select i1 true, i32 0, i32 1
1019 select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1020 ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1022 call void @f.nobuiltin() builtin
1023 ; CHECK: call void @f.nobuiltin() #39
1025 call fastcc noalias i32* @f.noalias() noinline
1026 ; CHECK: call fastcc noalias ptr @f.noalias() #12
1027 tail call ghccc nonnull i32* @f.nonnull() minsize
1028 ; CHECK: tail call ghccc nonnull ptr @f.nonnull() #7
1033 define void @instructions.call_musttail(i8* inalloca %val) {
1034 musttail call void @f.param.inalloca(i8* inalloca %val)
1035 ; CHECK: musttail call void @f.param.inalloca(ptr inalloca(i8) %val)
1040 define void @instructions.landingpad() personality i32 -2 {
1041 invoke void @llvm.donothing() to label %proceed unwind label %catch1
1042 invoke void @llvm.donothing() to label %proceed unwind label %catch2
1043 invoke void @llvm.donothing() to label %proceed unwind label %catch3
1044 invoke void @llvm.donothing() to label %proceed unwind label %catch4
1048 ; CHECK: landingpad i32
1055 ; CHECK: landingpad i32
1059 ; CHECK: catch ptr null
1064 ; CHECK: landingpad i32
1068 ; CHECK: catch ptr null
1070 ; CHECK: catch ptr null
1075 ; CHECK: landingpad i32
1076 filter [2 x i32] zeroinitializer
1077 ; CHECK: filter [2 x i32] zeroinitializer
1084 ;; Intrinsic Functions
1086 ; Intrinsic Functions -- Variable Argument Handling
1087 declare void @llvm.va_start(i8*)
1088 declare void @llvm.va_copy(i8*, i8*)
1089 declare void @llvm.va_end(i8*)
1090 define void @instructions.va_arg(i8* %v, ...) {
1092 %ap2 = bitcast i8** %ap to i8*
1094 call void @llvm.va_start(i8* %ap2)
1095 ; CHECK: call void @llvm.va_start.p0(ptr %ap2)
1097 va_arg i8* %ap2, i32
1098 ; CHECK: va_arg ptr %ap2, i32
1100 call void @llvm.va_copy(i8* %v, i8* %ap2)
1101 ; CHECK: call void @llvm.va_copy.p0(ptr %v, ptr %ap2)
1103 call void @llvm.va_end(i8* %ap2)
1104 ; CHECK: call void @llvm.va_end.p0(ptr %ap2)
1109 ; Intrinsic Functions -- Accurate Garbage Collection
1110 declare void @llvm.gcroot(i8**, i8*)
1111 declare i8* @llvm.gcread(i8*, i8**)
1112 declare void @llvm.gcwrite(i8*, i8*, i8**)
1113 define void @intrinsics.gc() gc "shadow-stack" {
1114 %ptrloc = alloca i8*
1115 call void @llvm.gcroot(i8** %ptrloc, i8* null)
1116 ; CHECK: call void @llvm.gcroot(ptr %ptrloc, ptr null)
1118 call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1119 ; CHECK: call ptr @llvm.gcread(ptr null, ptr %ptrloc)
1122 call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1123 ; CHECK: call void @llvm.gcwrite(ptr %ref, ptr null, ptr %ptrloc)
1128 ; Intrinsic Functions -- Code Generation
1129 declare i8* @llvm.returnaddress(i32)
1130 declare i8* @llvm.frameaddress(i32)
1131 declare i32 @llvm.read_register.i32(metadata)
1132 declare i64 @llvm.read_register.i64(metadata)
1133 declare void @llvm.write_register.i32(metadata, i32)
1134 declare void @llvm.write_register.i64(metadata, i64)
1135 declare i8* @llvm.stacksave()
1136 declare void @llvm.stackrestore(i8*)
1137 declare void @llvm.prefetch(i8*, i32, i32, i32)
1138 declare void @llvm.pcmarker(i32)
1139 declare i64 @llvm.readcyclecounter()
1140 declare void @llvm.clear_cache(i8*, i8*)
1141 declare void @llvm.instrprof_increment(i8*, i64, i32, i32)
1144 define void @intrinsics.codegen() {
1145 call i8* @llvm.returnaddress(i32 1)
1146 ; CHECK: call ptr @llvm.returnaddress(i32 1)
1147 call i8* @llvm.frameaddress(i32 1)
1148 ; CHECK: call ptr @llvm.frameaddress.p0(i32 1)
1150 call i32 @llvm.read_register.i32(metadata !10)
1151 ; CHECK: call i32 @llvm.read_register.i32(metadata !10)
1152 call i64 @llvm.read_register.i64(metadata !10)
1153 ; CHECK: call i64 @llvm.read_register.i64(metadata !10)
1154 call void @llvm.write_register.i32(metadata !10, i32 0)
1155 ; CHECK: call void @llvm.write_register.i32(metadata !10, i32 0)
1156 call void @llvm.write_register.i64(metadata !10, i64 0)
1157 ; CHECK: call void @llvm.write_register.i64(metadata !10, i64 0)
1159 %stack = call i8* @llvm.stacksave()
1160 ; CHECK: %stack = call ptr @llvm.stacksave.p0()
1161 call void @llvm.stackrestore(i8* %stack)
1162 ; CHECK: call void @llvm.stackrestore.p0(ptr %stack)
1164 call void @llvm.prefetch(i8* %stack, i32 0, i32 3, i32 0)
1165 ; CHECK: call void @llvm.prefetch.p0(ptr %stack, i32 0, i32 3, i32 0)
1167 call void @llvm.pcmarker(i32 1)
1168 ; CHECK: call void @llvm.pcmarker(i32 1)
1170 call i64 @llvm.readcyclecounter()
1171 ; CHECK: call i64 @llvm.readcyclecounter()
1173 call void @llvm.clear_cache(i8* null, i8* null)
1174 ; CHECK: call void @llvm.clear_cache(ptr null, ptr null)
1176 call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1177 ; CHECK: call void @llvm.instrprof_increment(ptr null, i64 0, i32 0, i32 0)
1182 declare void @llvm.localescape(...)
1183 declare i8* @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
1184 define void @intrinsics.localescape() {
1185 %static.alloca = alloca i32
1186 call void (...) @llvm.localescape(i32* %static.alloca)
1187 ; CHECK: call void (...) @llvm.localescape(ptr %static.alloca)
1189 call void @intrinsics.localrecover()
1193 define void @intrinsics.localrecover() {
1194 %func = bitcast void ()* @intrinsics.localescape to i8*
1195 %fp = call i8* @llvm.frameaddress(i32 1)
1196 call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1197 ; CHECK: call ptr @llvm.localrecover(ptr %func, ptr %fp, i32 0)
1202 ; We need this function to provide `uses' for some metadata tests.
1203 define void @misc.metadata() {
1204 call void @f1(), !srcloc !11
1205 call void @f1(), !srcloc !12
1206 call void @f1(), !srcloc !13
1207 call void @f1(), !srcloc !14
1211 ; CHECK: attributes #0 = { alignstack=4 }
1212 ; CHECK: attributes #1 = { alignstack=8 }
1213 ; CHECK: attributes #2 = { alwaysinline }
1214 ; CHECK: attributes #3 = { cold }
1215 ; CHECK: attributes #4 = { convergent }
1216 ; CHECK: attributes #5 = { inlinehint }
1217 ; CHECK: attributes #6 = { jumptable }
1218 ; CHECK: attributes #7 = { minsize }
1219 ; CHECK: attributes #8 = { naked }
1220 ; CHECK: attributes #9 = { nobuiltin }
1221 ; CHECK: attributes #10 = { noduplicate }
1222 ; CHECK: attributes #11 = { noimplicitfloat }
1223 ; CHECK: attributes #12 = { noinline }
1224 ; CHECK: attributes #13 = { nonlazybind }
1225 ; CHECK: attributes #14 = { noredzone }
1226 ; CHECK: attributes #15 = { noreturn }
1227 ; CHECK: attributes #16 = { nounwind }
1228 ; CHECK: attributes #17 = { noinline optnone }
1229 ; CHECK: attributes #18 = { optsize }
1230 ; CHECK: attributes #19 = { memory(none) }
1231 ; CHECK: attributes #20 = { memory(read) }
1232 ; CHECK: attributes #21 = { returns_twice }
1233 ; CHECK: attributes #22 = { safestack }
1234 ; CHECK: attributes #23 = { sanitize_address }
1235 ; CHECK: attributes #24 = { sanitize_memory }
1236 ; CHECK: attributes #25 = { sanitize_thread }
1237 ; CHECK: attributes #26 = { ssp }
1238 ; CHECK: attributes #27 = { sspreq }
1239 ; CHECK: attributes #28 = { sspstrong }
1240 ; CHECK: attributes #29 = { "thunk" }
1241 ; CHECK: attributes #30 = { uwtable }
1242 ; CHECK: attributes #31 = { "cpu"="cortex-a8" }
1243 ; CHECK: attributes #32 = { nocallback nofree nosync nounwind willreturn memory(none) }
1244 ; CHECK: attributes #33 = { nounwind memory(argmem: read) }
1245 ; CHECK: attributes #34 = { nounwind memory(argmem: readwrite) }
1246 ; CHECK: attributes #35 = { nocallback nofree nosync nounwind willreturn memory(read) }
1247 ; CHECK: attributes #36 = { nocallback nounwind }
1248 ; CHECK: attributes #37 = { nocallback nofree nosync nounwind willreturn }
1249 ; CHECK: attributes #38 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
1250 ; CHECK: attributes #39 = { builtin }
1254 ; Metadata -- Module flags
1255 !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1256 ; CHECK: !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1258 !0 = !{i32 1, !"mod1", i32 0}
1259 ; CHECK: !0 = !{i32 1, !"mod1", i32 0}
1260 !1 = !{i32 2, !"mod2", i32 0}
1261 ; CHECK: !1 = !{i32 2, !"mod2", i32 0}
1262 !2 = !{i32 3, !"mod3", !3}
1263 ; CHECK: !2 = !{i32 3, !"mod3", !3}
1265 ; CHECK: !3 = !{!"mod6", !0}
1266 !4 = !{i32 4, !"mod4", i32 0}
1267 ; CHECK: !4 = !{i32 4, !"mod4", i32 0}
1268 !5 = !{i32 5, !"mod5", !0}
1269 ; CHECK: !5 = !{i32 5, !"mod5", !0}
1270 !6 = !{i32 6, !"mod6", !0}
1271 ; CHECK: !6 = !{i32 6, !"mod6", !0}
1273 ; Metadata -- Check `distinct'
1275 ; CHECK: !11 = distinct !{}
1277 ; CHECK: !12 = distinct !{}
1279 ; CHECK: !13 = !{!11}
1281 ; CHECK: !14 = !{!12}