1 ; Bitcode compatibility test for llvm 6.0.0
3 ; N.b: This is 6.0-compatible IR. The CHECK lines occasionally differ from
4 ; the IR used to generate the bitcode, and may need to be updated.
6 ; RUN: llvm-dis < %s.bc | FileCheck %s
8 target datalayout = "E"
9 ; CHECK: target datalayout = "E"
11 target triple = "x86_64-apple-macosx10.10.0"
12 ; CHECK: target triple = "x86_64-apple-macosx10.10.0"
14 ;; Module-level assembly
15 module asm "beep boop"
16 ; CHECK: module asm "beep boop"
19 $comdat.any = comdat any
20 ; CHECK: $comdat.any = comdat any
21 $comdat.exactmatch = comdat exactmatch
22 ; CHECK: $comdat.exactmatch = comdat exactmatch
23 $comdat.largest = comdat largest
24 ; CHECK: $comdat.largest = comdat largest
25 $comdat.noduplicates = comdat nodeduplicate
26 ; CHECK: $comdat.noduplicates = comdat nodeduplicate
27 $comdat.samesize = comdat samesize
28 ; CHECK: $comdat.samesize = comdat samesize
31 @const.true = constant i1 true
32 ; CHECK: @const.true = constant i1 true
33 @const.false = constant i1 false
34 ; CHECK: @const.false = constant i1 false
35 @const.int = constant i32 zeroinitializer
36 ; CHECK: @const.int = constant i32 0
37 @const.float = constant double 0.0
38 ; CHECK: @const.float = constant double 0.0
39 @const.null = constant i8* null
40 ; CHECK: @const.null = constant ptr null
41 %const.struct.type = type { i32, i8 }
42 %const.struct.type.packed = type <{ i32, i8 }>
43 @const.struct = constant %const.struct.type { i32 -1, i8 undef }
44 ; CHECK: @const.struct = constant %const.struct.type { i32 -1, i8 undef }
45 @const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }>
46 ; CHECK: @const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }>
48 ; CHECK: @constant.array.i8 = constant [3 x i8] c"\00\01\00"
49 @constant.array.i8 = constant [3 x i8] [i8 -0, i8 1, i8 0]
50 ; CHECK: @constant.array.i16 = constant [3 x i16] [i16 0, i16 1, i16 0]
51 @constant.array.i16 = constant [3 x i16] [i16 -0, i16 1, i16 0]
52 ; CHECK: @constant.array.i32 = constant [3 x i32] [i32 0, i32 1, i32 0]
53 @constant.array.i32 = constant [3 x i32] [i32 -0, i32 1, i32 0]
54 ; CHECK: @constant.array.i64 = constant [3 x i64] [i64 0, i64 1, i64 0]
55 @constant.array.i64 = constant [3 x i64] [i64 -0, i64 1, i64 0]
56 ; CHECK: @constant.array.f16 = constant [3 x half] [half 0xH8000, half 0xH3C00, half 0xH0000]
57 @constant.array.f16 = constant [3 x half] [half -0.0, half 1.0, half 0.0]
58 ; CHECK: @constant.array.f32 = constant [3 x float] [float -0.000000e+00, float 1.000000e+00, float 0.000000e+00]
59 @constant.array.f32 = constant [3 x float] [float -0.0, float 1.0, float 0.0]
60 ; CHECK: @constant.array.f64 = constant [3 x double] [double -0.000000e+00, double 1.000000e+00, double 0.000000e+00]
61 @constant.array.f64 = constant [3 x double] [double -0.0, double 1.0, double 0.0]
63 ; CHECK: @constant.vector.i8 = constant <3 x i8> <i8 0, i8 1, i8 0>
64 @constant.vector.i8 = constant <3 x i8> <i8 -0, i8 1, i8 0>
65 ; CHECK: @constant.vector.i16 = constant <3 x i16> <i16 0, i16 1, i16 0>
66 @constant.vector.i16 = constant <3 x i16> <i16 -0, i16 1, i16 0>
67 ; CHECK: @constant.vector.i32 = constant <3 x i32> <i32 0, i32 1, i32 0>
68 @constant.vector.i32 = constant <3 x i32> <i32 -0, i32 1, i32 0>
69 ; CHECK: @constant.vector.i64 = constant <3 x i64> <i64 0, i64 1, i64 0>
70 @constant.vector.i64 = constant <3 x i64> <i64 -0, i64 1, i64 0>
71 ; CHECK: @constant.vector.f16 = constant <3 x half> <half 0xH8000, half 0xH3C00, half 0xH0000>
72 @constant.vector.f16 = constant <3 x half> <half -0.0, half 1.0, half 0.0>
73 ; CHECK: @constant.vector.f32 = constant <3 x float> <float -0.000000e+00, float 1.000000e+00, float 0.000000e+00>
74 @constant.vector.f32 = constant <3 x float> <float -0.0, float 1.0, float 0.0>
75 ; CHECK: @constant.vector.f64 = constant <3 x double> <double -0.000000e+00, double 1.000000e+00, double 0.000000e+00>
76 @constant.vector.f64 = constant <3 x double> <double -0.0, double 1.0, double 0.0>
79 ; Format: [@<GlobalVarName> =] [Linkage] [Visibility] [DLLStorageClass]
80 ; [ThreadLocal] [(unnamed_addr|local_unnamed_addr)] [AddrSpace] [ExternallyInitialized]
81 ; <global | constant> <Type> [<InitializerConstant>]
82 ; [, section "name"] [, comdat [($name)]] [, align <Alignment>]
84 ; Global Variables -- Simple
86 ; CHECK: @g1 = global i32 0
88 ; CHECK: @g2 = constant i32 0
90 ; Global Variables -- Linkage
91 @g.private = private global i32 0
92 ; CHECK: @g.private = private global i32 0
93 @g.internal = internal global i32 0
94 ; CHECK: @g.internal = internal global i32 0
95 @g.available_externally = available_externally global i32 0
96 ; CHECK: @g.available_externally = available_externally global i32 0
97 @g.linkonce = linkonce global i32 0
98 ; CHECK: @g.linkonce = linkonce global i32 0
99 @g.weak = weak global i32 0
100 ; CHECK: @g.weak = weak global i32 0
101 @g.common = common global i32 0
102 ; CHECK: @g.common = common global i32 0
103 @g.appending = appending global [4 x i8] c"test"
104 ; CHECK: @g.appending = appending global [4 x i8] c"test"
105 @g.extern_weak = extern_weak global i32
106 ; CHECK: @g.extern_weak = extern_weak global i32
107 @g.linkonce_odr = linkonce_odr global i32 0
108 ; CHECK: @g.linkonce_odr = linkonce_odr global i32 0
109 @g.weak_odr = weak_odr global i32 0
110 ; CHECK: @g.weak_odr = weak_odr global i32 0
111 @g.external = external global i32
112 ; CHECK: @g.external = external global i32
114 ; Global Variables -- Visibility
115 @g.default = default global i32 0
116 ; CHECK: @g.default = global i32 0
117 @g.hidden = hidden global i32 0
118 ; CHECK: @g.hidden = hidden global i32 0
119 @g.protected = protected global i32 0
120 ; CHECK: @g.protected = protected global i32 0
122 ; Global Variables -- DLLStorageClass
123 @g.dlldefault = default global i32 0
124 ; CHECK: @g.dlldefault = global i32 0
125 @g.dllimport = external dllimport global i32
126 ; CHECK: @g.dllimport = external dllimport global i32
127 @g.dllexport = dllexport global i32 0
128 ; CHECK: @g.dllexport = dllexport global i32 0
130 ; Global Variables -- ThreadLocal
131 @g.notthreadlocal = global i32 0
132 ; CHECK: @g.notthreadlocal = global i32 0
133 @g.generaldynamic = thread_local global i32 0
134 ; CHECK: @g.generaldynamic = thread_local global i32 0
135 @g.localdynamic = thread_local(localdynamic) global i32 0
136 ; CHECK: @g.localdynamic = thread_local(localdynamic) global i32 0
137 @g.initialexec = thread_local(initialexec) global i32 0
138 ; CHECK: @g.initialexec = thread_local(initialexec) global i32 0
139 @g.localexec = thread_local(localexec) global i32 0
140 ; CHECK: @g.localexec = thread_local(localexec) global i32 0
142 ; Global Variables -- unnamed_addr and local_unnamed_addr
143 @g.unnamed_addr = unnamed_addr global i32 0
144 ; CHECK: @g.unnamed_addr = unnamed_addr global i32 0
145 @g.local_unnamed_addr = local_unnamed_addr global i32 0
146 ; CHECK: @g.local_unnamed_addr = local_unnamed_addr global i32 0
148 ; Global Variables -- AddrSpace
149 @g.addrspace = addrspace(1) global i32 0
150 ; CHECK: @g.addrspace = addrspace(1) global i32 0
152 ; Global Variables -- ExternallyInitialized
153 @g.externally_initialized = external externally_initialized global i32
154 ; CHECK: @g.externally_initialized = external externally_initialized global i32
156 ; Global Variables -- section
157 @g.section = global i32 0, section "_DATA"
158 ; CHECK: @g.section = global i32 0, section "_DATA"
160 ; Global Variables -- comdat
161 @comdat.any = global i32 0, comdat
162 ; CHECK: @comdat.any = global i32 0, comdat
163 @comdat.exactmatch = global i32 0, comdat
164 ; CHECK: @comdat.exactmatch = global i32 0, comdat
165 @comdat.largest = global i32 0, comdat
166 ; CHECK: @comdat.largest = global i32 0, comdat
167 @comdat.noduplicates = global i32 0, comdat
168 ; CHECK: @comdat.noduplicates = global i32 0, comdat
169 @comdat.samesize = global i32 0, comdat
170 ; CHECK: @comdat.samesize = global i32 0, comdat
172 ; Force two globals from different comdats into sections with the same name.
173 $comdat1 = comdat any
174 $comdat2 = comdat any
175 @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
176 ; CHECK: @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
177 @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
178 ; CHECK: @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
180 ; Global Variables -- align
181 @g.align = global i32 0, align 4
182 ; CHECK: @g.align = global i32 0, align 4
184 ; Global Variables -- Intrinsics
185 %pri.func.data = type { i32, void ()*, i8* }
186 @g.used1 = global i32 0
187 @g.used2 = global i32 0
188 @g.used3 = global i8 0
190 @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
191 ; CHECK: @llvm.used = appending global [1 x ptr] [ptr @g.used1], section "llvm.metadata"
192 @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
193 ; CHECK: @llvm.compiler.used = appending global [1 x ptr] [ptr @g.used2], section "llvm.metadata"
194 @llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
195 ; 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"
196 @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
197 ; 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"
200 ; Format: @<Name> = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
201 ; [unnamed_addr] alias <AliaseeTy> @<Aliasee>
204 @a.private = private alias i32, i32* @g.private
205 ; CHECK: @a.private = private alias i32, ptr @g.private
206 @a.internal = internal alias i32, i32* @g.internal
207 ; CHECK: @a.internal = internal alias i32, ptr @g.internal
208 @a.linkonce = linkonce alias i32, i32* @g.linkonce
209 ; CHECK: @a.linkonce = linkonce alias i32, ptr @g.linkonce
210 @a.weak = weak alias i32, i32* @g.weak
211 ; CHECK: @a.weak = weak alias i32, ptr @g.weak
212 @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
213 ; CHECK: @a.linkonce_odr = linkonce_odr alias i32, ptr @g.linkonce_odr
214 @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
215 ; CHECK: @a.weak_odr = weak_odr alias i32, ptr @g.weak_odr
216 @a.external = external alias i32, i32* @g1
217 ; CHECK: @a.external = alias i32, ptr @g1
219 ; Aliases -- Visibility
220 @a.default = default alias i32, i32* @g.default
221 ; CHECK: @a.default = alias i32, ptr @g.default
222 @a.hidden = hidden alias i32, i32* @g.hidden
223 ; CHECK: @a.hidden = hidden alias i32, ptr @g.hidden
224 @a.protected = protected alias i32, i32* @g.protected
225 ; CHECK: @a.protected = protected alias i32, ptr @g.protected
227 ; Aliases -- DLLStorageClass
228 @a.dlldefault = default alias i32, i32* @g.dlldefault
229 ; CHECK: @a.dlldefault = alias i32, ptr @g.dlldefault
230 @a.dllexport = dllexport alias i32, i32* @g.dllexport
231 ; CHECK: @a.dllexport = dllexport alias i32, ptr @g.dllexport
233 ; Aliases -- ThreadLocal
234 @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
235 ; CHECK: @a.notthreadlocal = alias i32, ptr @g.notthreadlocal
236 @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
237 ; CHECK: @a.generaldynamic = thread_local alias i32, ptr @g.generaldynamic
238 @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
239 ; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, ptr @g.localdynamic
240 @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
241 ; CHECK: @a.initialexec = thread_local(initialexec) alias i32, ptr @g.initialexec
242 @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
243 ; CHECK: @a.localexec = thread_local(localexec) alias i32, ptr @g.localexec
245 ; Aliases -- unnamed_addr and local_unnamed_addr
246 @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
247 ; CHECK: @a.unnamed_addr = unnamed_addr alias i32, ptr @g.unnamed_addr
248 @a.local_unnamed_addr = local_unnamed_addr alias i32, i32* @g.local_unnamed_addr
249 ; CHECK: @a.local_unnamed_addr = local_unnamed_addr alias i32, ptr @g.local_unnamed_addr
252 ; Format @<Name> = [Linkage] [Visibility] ifunc <IFuncTy>,
256 @ifunc.external = external ifunc void (), i8* ()* @ifunc_resolver
257 ; CHECK: @ifunc.external = ifunc void (), ptr @ifunc_resolver
258 @ifunc.private = private ifunc void (), i8* ()* @ifunc_resolver
259 ; CHECK: @ifunc.private = private ifunc void (), ptr @ifunc_resolver
260 @ifunc.internal = internal ifunc void (), i8* ()* @ifunc_resolver
261 ; CHECK: @ifunc.internal = internal ifunc void (), ptr @ifunc_resolver
263 ; IFunc -- Visibility
264 @ifunc.default = default ifunc void (), i8* ()* @ifunc_resolver
265 ; CHECK: @ifunc.default = ifunc void (), ptr @ifunc_resolver
266 @ifunc.hidden = hidden ifunc void (), i8* ()* @ifunc_resolver
267 ; CHECK: @ifunc.hidden = hidden ifunc void (), ptr @ifunc_resolver
268 @ifunc.protected = protected ifunc void (), i8* ()* @ifunc_resolver
269 ; CHECK: @ifunc.protected = protected ifunc void (), ptr @ifunc_resolver
271 define i8* @ifunc_resolver() {
277 ; Format: define [linkage] [visibility] [DLLStorageClass]
278 ; [cconv] [ret attrs]
279 ; <ResultType> @<FunctionName> ([argument list])
280 ; [(unnamed_addr|local_unnamed_addr)] [fn Attrs] [section "name"] [comdat [($name)]]
281 ; [align N] [gc] [prefix Constant] [prologue Constant]
282 ; [personality Constant] { ... }
284 ; Functions -- Simple
286 ; CHECK: declare void @f1()
289 ; CHECK: define void @f2()
294 ; Functions -- linkage
295 define private void @f.private() {
296 ; CHECK: define private void @f.private()
300 define internal void @f.internal() {
301 ; CHECK: define internal void @f.internal()
305 define available_externally void @f.available_externally() {
306 ; CHECK: define available_externally void @f.available_externally()
310 define linkonce void @f.linkonce() {
311 ; CHECK: define linkonce void @f.linkonce()
315 define weak void @f.weak() {
316 ; CHECK: define weak void @f.weak()
320 define linkonce_odr void @f.linkonce_odr() {
321 ; CHECK: define linkonce_odr void @f.linkonce_odr()
325 define weak_odr void @f.weak_odr() {
326 ; CHECK: define weak_odr void @f.weak_odr()
330 declare external void @f.external()
331 ; CHECK: declare void @f.external()
332 declare extern_weak void @f.extern_weak()
333 ; CHECK: declare extern_weak void @f.extern_weak()
335 ; Functions -- visibility
336 declare default void @f.default()
337 ; CHECK: declare void @f.default()
338 declare hidden void @f.hidden()
339 ; CHECK: declare hidden void @f.hidden()
340 declare protected void @f.protected()
341 ; CHECK: declare protected void @f.protected()
343 ; Functions -- DLLStorageClass
344 declare dllimport void @f.dllimport()
345 ; CHECK: declare dllimport void @f.dllimport()
346 declare dllexport void @f.dllexport()
347 ; CHECK: declare dllexport void @f.dllexport()
349 ; Functions -- cconv (Calling conventions)
350 declare ccc void @f.ccc()
351 ; CHECK: declare void @f.ccc()
352 declare fastcc void @f.fastcc()
353 ; CHECK: declare fastcc void @f.fastcc()
354 declare coldcc void @f.coldcc()
355 ; CHECK: declare coldcc void @f.coldcc()
356 declare cc10 void @f.cc10()
357 ; CHECK: declare ghccc void @f.cc10()
358 declare ghccc void @f.ghccc()
359 ; CHECK: declare ghccc void @f.ghccc()
360 declare cc11 void @f.cc11()
361 ; CHECK: declare cc11 void @f.cc11()
362 declare anyregcc void @f.anyregcc()
363 ; CHECK: declare anyregcc void @f.anyregcc()
364 declare preserve_mostcc void @f.preserve_mostcc()
365 ; CHECK: declare preserve_mostcc void @f.preserve_mostcc()
366 declare preserve_allcc void @f.preserve_allcc()
367 ; CHECK: declare preserve_allcc void @f.preserve_allcc()
368 declare cc64 void @f.cc64()
369 ; CHECK: declare x86_stdcallcc void @f.cc64()
370 declare x86_stdcallcc void @f.x86_stdcallcc()
371 ; CHECK: declare x86_stdcallcc void @f.x86_stdcallcc()
372 declare cc65 void @f.cc65()
373 ; CHECK: declare x86_fastcallcc void @f.cc65()
374 declare x86_fastcallcc void @f.x86_fastcallcc()
375 ; CHECK: declare x86_fastcallcc void @f.x86_fastcallcc()
376 declare cc66 void @f.cc66()
377 ; CHECK: declare arm_apcscc void @f.cc66()
378 declare arm_apcscc void @f.arm_apcscc()
379 ; CHECK: declare arm_apcscc void @f.arm_apcscc()
380 declare cc67 void @f.cc67()
381 ; CHECK: declare arm_aapcscc void @f.cc67()
382 declare arm_aapcscc void @f.arm_aapcscc()
383 ; CHECK: declare arm_aapcscc void @f.arm_aapcscc()
384 declare cc68 void @f.cc68()
385 ; CHECK: declare arm_aapcs_vfpcc void @f.cc68()
386 declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
387 ; CHECK: declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
388 declare cc69 void @f.cc69()
389 ; CHECK: declare msp430_intrcc void @f.cc69()
390 declare msp430_intrcc void @f.msp430_intrcc()
391 ; CHECK: declare msp430_intrcc void @f.msp430_intrcc()
392 declare cc70 void @f.cc70()
393 ; CHECK: declare x86_thiscallcc void @f.cc70()
394 declare x86_thiscallcc void @f.x86_thiscallcc()
395 ; CHECK: declare x86_thiscallcc void @f.x86_thiscallcc()
396 declare cc71 void @f.cc71()
397 ; CHECK: declare ptx_kernel void @f.cc71()
398 declare ptx_kernel void @f.ptx_kernel()
399 ; CHECK: declare ptx_kernel void @f.ptx_kernel()
400 declare cc72 void @f.cc72()
401 ; CHECK: declare ptx_device void @f.cc72()
402 declare ptx_device void @f.ptx_device()
403 ; CHECK: declare ptx_device void @f.ptx_device()
404 declare cc75 void @f.cc75()
405 ; CHECK: declare spir_func void @f.cc75()
406 declare spir_func void @f.spir_func()
407 ; CHECK: declare spir_func void @f.spir_func()
408 declare cc76 void @f.cc76()
409 ; CHECK: declare spir_kernel void @f.cc76()
410 declare spir_kernel void @f.spir_kernel()
411 ; CHECK: declare spir_kernel void @f.spir_kernel()
412 declare cc77 void @f.cc77()
413 ; CHECK: declare intel_ocl_bicc void @f.cc77()
414 declare intel_ocl_bicc void @f.intel_ocl_bicc()
415 ; CHECK: declare intel_ocl_bicc void @f.intel_ocl_bicc()
416 declare cc78 void @f.cc78()
417 ; CHECK: declare x86_64_sysvcc void @f.cc78()
418 declare x86_64_sysvcc void @f.x86_64_sysvcc()
419 ; CHECK: declare x86_64_sysvcc void @f.x86_64_sysvcc()
420 declare cc79 void @f.cc79()
421 ; CHECK: declare win64cc void @f.cc79()
422 declare win64cc void @f.win64cc()
423 ; CHECK: declare win64cc void @f.win64cc()
424 declare cc80 void @f.cc80()
425 ; CHECK: declare x86_vectorcallcc void @f.cc80()
426 declare x86_vectorcallcc void @f.x86_vectorcallcc()
427 ; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc()
428 declare cc81 void @f.cc81()
429 ; CHECK: declare hhvmcc void @f.cc81()
430 declare hhvmcc void @f.hhvmcc()
431 ; CHECK: declare hhvmcc void @f.hhvmcc()
432 declare cc82 void @f.cc82()
433 ; CHECK: declare hhvm_ccc void @f.cc82()
434 declare hhvm_ccc void @f.hhvm_ccc()
435 ; CHECK: declare hhvm_ccc void @f.hhvm_ccc()
436 declare cc83 void @f.cc83(i8* byval(i8))
437 ; CHECK: declare x86_intrcc void @f.cc83()
438 declare x86_intrcc void @f.x86_intrcc()
439 ; CHECK: declare x86_intrcc void @f.x86_intrcc()
440 declare cc84 void @f.cc84()
441 ; CHECK: declare avr_intrcc void @f.cc84()
442 declare avr_intrcc void @f.avr_intrcc()
443 ; CHECK: declare avr_intrcc void @f.avr_intrcc()
444 declare cc85 void @f.cc85()
445 ; CHECK: declare avr_signalcc void @f.cc85()
446 declare avr_signalcc void @f.avr_signalcc()
447 ; CHECK: declare avr_signalcc void @f.avr_signalcc()
448 declare cc87 void @f.cc87()
449 ; CHECK: declare amdgpu_vs void @f.cc87()
450 declare amdgpu_vs void @f.amdgpu_vs()
451 ; CHECK: declare amdgpu_vs void @f.amdgpu_vs()
452 declare cc88 void @f.cc88()
453 ; CHECK: declare amdgpu_gs void @f.cc88()
454 declare amdgpu_gs void @f.amdgpu_gs()
455 ; CHECK: declare amdgpu_gs void @f.amdgpu_gs()
456 declare cc89 void @f.cc89()
457 ; CHECK: declare amdgpu_ps void @f.cc89()
458 declare amdgpu_ps void @f.amdgpu_ps()
459 ; CHECK: declare amdgpu_ps void @f.amdgpu_ps()
460 declare cc90 void @f.cc90()
461 ; CHECK: declare amdgpu_cs void @f.cc90()
462 declare amdgpu_cs void @f.amdgpu_cs()
463 ; CHECK: declare amdgpu_cs void @f.amdgpu_cs()
464 declare cc91 void @f.cc91()
465 ; CHECK: declare amdgpu_kernel void @f.cc91()
466 declare amdgpu_kernel void @f.amdgpu_kernel()
467 ; CHECK: declare amdgpu_kernel void @f.amdgpu_kernel()
468 declare cc93 void @f.cc93()
469 ; CHECK: declare amdgpu_hs void @f.cc93()
470 declare amdgpu_hs void @f.amdgpu_hs()
471 ; CHECK: declare amdgpu_hs void @f.amdgpu_hs()
472 declare cc95 void @f.cc95()
473 ; CHECK: declare amdgpu_ls void @f.cc95()
474 declare amdgpu_ls void @f.amdgpu_ls()
475 ; CHECK: declare amdgpu_ls void @f.amdgpu_ls()
476 declare cc96 void @f.cc96()
477 ; CHECK: declare amdgpu_es void @f.cc96()
478 declare amdgpu_es void @f.amdgpu_es()
479 ; CHECK: declare amdgpu_es void @f.amdgpu_es()
480 declare cc1023 void @f.cc1023()
481 ; CHECK: declare cc1023 void @f.cc1023()
483 ; Functions -- ret attrs (Return attributes)
484 declare zeroext i64 @f.zeroext()
485 ; CHECK: declare zeroext i64 @f.zeroext()
486 declare signext i64 @f.signext()
487 ; CHECK: declare signext i64 @f.signext()
488 declare inreg i32* @f.inreg()
489 ; CHECK: declare inreg ptr @f.inreg()
490 declare noalias i32* @f.noalias()
491 ; CHECK: declare noalias ptr @f.noalias()
492 declare nonnull i32* @f.nonnull()
493 ; CHECK: declare nonnull ptr @f.nonnull()
494 declare dereferenceable(4) i32* @f.dereferenceable4()
495 ; CHECK: declare dereferenceable(4) ptr @f.dereferenceable4()
496 declare dereferenceable(8) i32* @f.dereferenceable8()
497 ; CHECK: declare dereferenceable(8) ptr @f.dereferenceable8()
498 declare dereferenceable(16) i32* @f.dereferenceable16()
499 ; CHECK: declare dereferenceable(16) ptr @f.dereferenceable16()
500 declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
501 ; CHECK: declare dereferenceable_or_null(4) ptr @f.dereferenceable4_or_null()
502 declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
503 ; CHECK: declare dereferenceable_or_null(8) ptr @f.dereferenceable8_or_null()
504 declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
505 ; CHECK: declare dereferenceable_or_null(16) ptr @f.dereferenceable16_or_null()
507 ; Functions -- Parameter attributes
508 declare void @f.param.zeroext(i8 zeroext)
509 ; CHECK: declare void @f.param.zeroext(i8 zeroext)
510 declare void @f.param.signext(i8 signext)
511 ; CHECK: declare void @f.param.signext(i8 signext)
512 declare void @f.param.inreg(i8 inreg)
513 ; CHECK: declare void @f.param.inreg(i8 inreg)
514 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
515 ; CHECK: declare void @f.param.byval(ptr byval({ i8, i8 }))
516 declare void @f.param.inalloca(i8* inalloca)
517 ; CHECK: declare void @f.param.inalloca(ptr inalloca(i8))
518 declare void @f.param.sret(i8* sret(i8))
519 ; CHECK: declare void @f.param.sret(ptr sret(i8))
520 declare void @f.param.noalias(i8* noalias)
521 ; CHECK: declare void @f.param.noalias(ptr noalias)
522 declare void @f.param.nocapture(i8* nocapture)
523 ; CHECK: declare void @f.param.nocapture(ptr nocapture)
524 declare void @f.param.nest(i8* nest)
525 ; CHECK: declare void @f.param.nest(ptr nest)
526 declare i8* @f.param.returned(i8* returned)
527 ; CHECK: declare ptr @f.param.returned(ptr returned)
528 declare void @f.param.nonnull(i8* nonnull)
529 ; CHECK: declare void @f.param.nonnull(ptr nonnull)
530 declare void @f.param.dereferenceable(i8* dereferenceable(4))
531 ; CHECK: declare void @f.param.dereferenceable(ptr dereferenceable(4))
532 declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
533 ; CHECK: declare void @f.param.dereferenceable_or_null(ptr dereferenceable_or_null(4))
535 ; Functions -- unnamed_addr and local_unnamed_addr
536 declare void @f.unnamed_addr() unnamed_addr
537 ; CHECK: declare void @f.unnamed_addr() unnamed_addr
538 declare void @f.local_unnamed_addr() local_unnamed_addr
539 ; CHECK: declare void @f.local_unnamed_addr() local_unnamed_addr
541 ; Functions -- fn Attrs (Function attributes)
542 declare void @f.alignstack4() alignstack(4)
543 ; CHECK: declare void @f.alignstack4() #0
544 declare void @f.alignstack8() alignstack(8)
545 ; CHECK: declare void @f.alignstack8() #1
546 declare void @f.alwaysinline() alwaysinline
547 ; CHECK: declare void @f.alwaysinline() #2
548 declare void @f.cold() cold
549 ; CHECK: declare void @f.cold() #3
550 declare void @f.convergent() convergent
551 ; CHECK: declare void @f.convergent() #4
552 declare void @f.inlinehint() inlinehint
553 ; CHECK: declare void @f.inlinehint() #5
554 declare void @f.jumptable() unnamed_addr jumptable
555 ; CHECK: declare void @f.jumptable() unnamed_addr #6
556 declare void @f.minsize() minsize
557 ; CHECK: declare void @f.minsize() #7
558 declare void @f.naked() naked
559 ; CHECK: declare void @f.naked() #8
560 declare void @f.nobuiltin() nobuiltin
561 ; CHECK: declare void @f.nobuiltin() #9
562 declare void @f.noduplicate() noduplicate
563 ; CHECK: declare void @f.noduplicate() #10
564 declare void @f.noimplicitfloat() noimplicitfloat
565 ; CHECK: declare void @f.noimplicitfloat() #11
566 declare void @f.noinline() noinline
567 ; CHECK: declare void @f.noinline() #12
568 declare void @f.nonlazybind() nonlazybind
569 ; CHECK: declare void @f.nonlazybind() #13
570 declare void @f.noredzone() noredzone
571 ; CHECK: declare void @f.noredzone() #14
572 declare void @f.noreturn() noreturn
573 ; CHECK: declare void @f.noreturn() #15
574 declare void @f.nounwind() nounwind
575 ; CHECK: declare void @f.nounwind() #16
576 declare void @f.optnone() noinline optnone
577 ; CHECK: declare void @f.optnone() #17
578 declare void @f.optsize() optsize
579 ; CHECK: declare void @f.optsize() #18
580 declare void @f.readnone() readnone
581 ; CHECK: declare void @f.readnone() #19
582 declare void @f.readonly() readonly
583 ; CHECK: declare void @f.readonly() #20
584 declare void @f.returns_twice() returns_twice
585 ; CHECK: declare void @f.returns_twice() #21
586 declare void @f.safestack() safestack
587 ; CHECK: declare void @f.safestack() #22
588 declare void @f.sanitize_address() sanitize_address
589 ; CHECK: declare void @f.sanitize_address() #23
590 declare void @f.sanitize_memory() sanitize_memory
591 ; CHECK: declare void @f.sanitize_memory() #24
592 declare void @f.sanitize_thread() sanitize_thread
593 ; CHECK: declare void @f.sanitize_thread() #25
594 declare void @f.ssp() ssp
595 ; CHECK: declare void @f.ssp() #26
596 declare void @f.sspreq() sspreq
597 ; CHECK: declare void @f.sspreq() #27
598 declare void @f.sspstrong() sspstrong
599 ; CHECK: declare void @f.sspstrong() #28
600 declare void @f.thunk() "thunk"
601 ; CHECK: declare void @f.thunk() #29
602 declare void @f.uwtable() uwtable
603 ; CHECK: declare void @f.uwtable() #30
604 declare void @f.kvpair() "cpu"="cortex-a8"
605 ; CHECK:declare void @f.kvpair() #31
606 declare void @f.norecurse() norecurse
607 ; CHECK: declare void @f.norecurse() #32
608 declare void @f.inaccessiblememonly() inaccessiblememonly
609 ; CHECK: declare void @f.inaccessiblememonly() #33
610 declare void @f.inaccessiblemem_or_argmemonly() inaccessiblemem_or_argmemonly
611 ; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #34
612 declare void @f.strictfp() #35
614 ; Functions -- section
615 declare void @f.section() section "80"
616 ; CHECK: declare void @f.section() section "80"
618 ; Functions -- comdat
619 define void @f.comdat_any() comdat($comdat.any) {
620 ; CHECK: define void @f.comdat_any() comdat($comdat.any)
624 define void @f.comdat_exactmatch() comdat($comdat.exactmatch) {
625 ; CHECK: define void @f.comdat_exactmatch() comdat($comdat.exactmatch)
629 define void @f.comdat_largest() comdat($comdat.largest) {
630 ; CHECK: define void @f.comdat_largest() comdat($comdat.largest)
634 define void @f.comdat_noduplicates() comdat($comdat.noduplicates) {
635 ; CHECK: define void @f.comdat_noduplicates() comdat($comdat.noduplicates)
639 define void @f.comdat_samesize() comdat($comdat.samesize) {
640 ; CHECK: define void @f.comdat_samesize() comdat($comdat.samesize)
646 declare void @f.align2() align 2
647 ; CHECK: declare void @f.align2() align 2
648 declare void @f.align4() align 4
649 ; CHECK: declare void @f.align4() align 4
650 declare void @f.align8() align 8
651 ; CHECK: declare void @f.align8() align 8
654 declare void @f.gcshadow() gc "shadow-stack"
655 ; CHECK: declare void @f.gcshadow() gc "shadow-stack"
657 ; Functions -- Prefix data
658 declare void @f.prefixi32() prefix i32 1684365668
659 ; CHECK: declare void @f.prefixi32() prefix i32 1684365668
660 declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
661 ; CHECK: declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
663 ; Functions -- Prologue data
664 declare void @f.prologuei32() prologue i32 1684365669
665 ; CHECK: declare void @f.prologuei32() prologue i32 1684365669
666 declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
667 ; CHECK: declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
669 ; Functions -- Personality constant
670 declare void @llvm.donothing() nounwind readnone
671 ; CHECK: declare void @llvm.donothing() #35
672 define void @f.no_personality() personality i8 3 {
673 ; CHECK: define void @f.no_personality() personality i8 3
674 invoke void @llvm.donothing() to label %normal unwind label %exception
676 %cleanup = landingpad i8 cleanup
682 declare i32 @f.personality_handler()
683 ; CHECK: declare i32 @f.personality_handler()
684 define void @f.personality() personality i32 ()* @f.personality_handler {
685 ; CHECK: define void @f.personality() personality ptr @f.personality_handler
686 invoke void @llvm.donothing() to label %normal unwind label %exception
688 %cleanup = landingpad i32 cleanup
694 ;; Atomic Memory Ordering Constraints
695 define void @atomics(i32* %word) {
696 %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
697 ; CHECK: %cmpxchg.0 = cmpxchg ptr %word, i32 0, i32 4 monotonic monotonic
698 %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
699 ; CHECK: %cmpxchg.1 = cmpxchg ptr %word, i32 0, i32 5 acq_rel monotonic
700 %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
701 ; CHECK: %cmpxchg.2 = cmpxchg ptr %word, i32 0, i32 6 acquire monotonic
702 %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
703 ; CHECK: %cmpxchg.3 = cmpxchg ptr %word, i32 0, i32 7 release monotonic
704 %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
705 ; CHECK: %cmpxchg.4 = cmpxchg ptr %word, i32 0, i32 8 seq_cst monotonic
706 %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
707 ; CHECK: %cmpxchg.5 = cmpxchg weak ptr %word, i32 0, i32 9 seq_cst monotonic
708 %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
709 ; CHECK: %cmpxchg.6 = cmpxchg volatile ptr %word, i32 0, i32 10 seq_cst monotonic
710 %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
711 ; CHECK: %cmpxchg.7 = cmpxchg weak volatile ptr %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
712 %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
713 ; CHECK: %atomicrmw.xchg = atomicrmw xchg ptr %word, i32 12 monotonic
714 %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic
715 ; CHECK: %atomicrmw.add = atomicrmw add ptr %word, i32 13 monotonic
716 %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic
717 ; CHECK: %atomicrmw.sub = atomicrmw sub ptr %word, i32 14 monotonic
718 %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic
719 ; CHECK: %atomicrmw.and = atomicrmw and ptr %word, i32 15 monotonic
720 %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic
721 ; CHECK: %atomicrmw.nand = atomicrmw nand ptr %word, i32 16 monotonic
722 %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic
723 ; CHECK: %atomicrmw.or = atomicrmw or ptr %word, i32 17 monotonic
724 %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic
725 ; CHECK: %atomicrmw.xor = atomicrmw xor ptr %word, i32 18 monotonic
726 %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic
727 ; CHECK: %atomicrmw.max = atomicrmw max ptr %word, i32 19 monotonic
728 %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic
729 ; CHECK: %atomicrmw.min = atomicrmw volatile min ptr %word, i32 20 monotonic
730 %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic
731 ; CHECK: %atomicrmw.umax = atomicrmw umax ptr %word, i32 21 syncscope("singlethread") monotonic
732 %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic
733 ; CHECK: %atomicrmw.umin = atomicrmw volatile umin ptr %word, i32 22 syncscope("singlethread") monotonic
735 ; CHECK: fence acquire
737 ; CHECK: fence release
739 ; CHECK: fence acq_rel
740 fence syncscope("singlethread") seq_cst
741 ; CHECK: fence syncscope("singlethread") seq_cst
743 %ld.1 = load atomic i32, i32* %word monotonic, align 4
744 ; CHECK: %ld.1 = load atomic i32, ptr %word monotonic, align 4
745 %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
746 ; CHECK: %ld.2 = load atomic volatile i32, ptr %word acquire, align 8
747 %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16
748 ; CHECK: %ld.3 = load atomic volatile i32, ptr %word syncscope("singlethread") seq_cst, align 16
750 store atomic i32 23, i32* %word monotonic, align 4
751 ; CHECK: store atomic i32 23, ptr %word monotonic, align 4
752 store atomic volatile i32 24, i32* %word monotonic, align 4
753 ; CHECK: store atomic volatile i32 24, ptr %word monotonic, align 4
754 store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4
755 ; CHECK: store atomic volatile i32 25, ptr %word syncscope("singlethread") monotonic, align 4
760 define void @fastmathflags(float %op1, float %op2) {
761 %f.nnan = fadd nnan float %op1, %op2
762 ; CHECK: %f.nnan = fadd nnan float %op1, %op2
763 %f.ninf = fadd ninf float %op1, %op2
764 ; CHECK: %f.ninf = fadd ninf float %op1, %op2
765 %f.nsz = fadd nsz float %op1, %op2
766 ; CHECK: %f.nsz = fadd nsz float %op1, %op2
767 %f.arcp = fadd arcp float %op1, %op2
768 ; CHECK: %f.arcp = fadd arcp float %op1, %op2
769 %f.contract = fadd contract float %op1, %op2
770 ; CHECK: %f.contract = fadd contract float %op1, %op2
771 %f.afn = fadd afn float %op1, %op2
772 ; CHECK: %f.afn = fadd afn float %op1, %op2
773 %f.reassoc = fadd reassoc float %op1, %op2
774 ; CHECK: %f.reassoc = fadd reassoc float %op1, %op2
775 %f.fast = fadd fast float %op1, %op2
776 ; CHECK: %f.fast = fadd fast float %op1, %op2
780 ; Check various fast math flags and floating-point types on calls.
782 declare float @fmf1()
783 declare double @fmf2()
784 declare <4 x double> @fmf3()
786 ; CHECK-LABEL: fastMathFlagsForCalls(
787 define void @fastMathFlagsForCalls(float %f, double %d1, <4 x double> %d2) {
788 %call.fast = call fast float @fmf1()
789 ; CHECK: %call.fast = call fast float @fmf1()
791 ; Throw in some other attributes to make sure those stay in the right places.
793 %call.nsz.arcp = notail call nsz arcp double @fmf2()
794 ; CHECK: %call.nsz.arcp = notail call nsz arcp double @fmf2()
796 %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
797 ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
803 %opaquety = type opaque
804 define void @typesystem() {
805 %p0 = bitcast i8* null to i32 (i32)*
806 ; CHECK: %p0 = bitcast ptr null to ptr
807 %p1 = bitcast i8* null to void (i8*)*
808 ; CHECK: %p1 = bitcast ptr null to ptr
809 %p2 = bitcast i8* null to i32 (i8*, ...)*
810 ; CHECK: %p2 = bitcast ptr null to ptr
811 %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
812 ; CHECK: %p3 = bitcast ptr null to ptr
813 %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
814 ; CHECK: %p4 = bitcast ptr null to ptr
815 %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
816 ; CHECK: %p5 = bitcast ptr null to ptr
818 %t0 = alloca i1942652
819 ; CHECK: %t0 = alloca i1942652
821 ; CHECK: %t1 = alloca half
823 ; CHECK: %t2 = alloca float
825 ; CHECK: %t3 = alloca double
827 ; CHECK: %t4 = alloca fp128
828 %t5 = alloca x86_fp80
829 ; CHECK: %t5 = alloca x86_fp80
830 %t6 = alloca ppc_fp128
831 ; CHECK: %t6 = alloca ppc_fp128
833 ; CHECK: %t7 = alloca x86_mmx
834 %t8 = alloca %opaquety*
835 ; CHECK: %t8 = alloca ptr
840 declare void @llvm.token(token)
841 ; CHECK: declare void @llvm.token(token)
843 ;; Inline Assembler Expressions
844 define void @inlineasm(i32 %arg) {
845 call i32 asm "bswap $0", "=r,r"(i32 %arg)
846 ; CHECK: call i32 asm "bswap $0", "=r,r"(i32 %arg)
847 call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
848 ; CHECK: call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
854 ; Instructions -- Terminators
855 define void @instructions.terminators(i8 %val) personality i32 -10 {
856 br i1 false, label %iftrue, label %iffalse
857 ; CHECK: br i1 false, label %iftrue, label %iffalse
859 ; CHECK: br label %iftrue
865 switch i8 %val, label %defaultdest [
866 ; CHECK: switch i8 %val, label %defaultdest [
867 i8 0, label %defaultdest.0
868 ; CHECK: i8 0, label %defaultdest.0
869 i8 1, label %defaultdest.1
870 ; CHECK: i8 1, label %defaultdest.1
871 i8 2, label %defaultdest.2
872 ; CHECK: i8 2, label %defaultdest.2
883 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
884 ; CHECK: indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
885 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
886 ; CHECK: indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
888 invoke fastcc void @f.fastcc()
889 ; CHECK: invoke fastcc void @f.fastcc()
890 to label %defaultdest unwind label %exc
891 ; CHECK: to label %defaultdest unwind label %exc
893 %cleanup = landingpad i32 cleanup
896 ; CHECK: resume i32 undef
903 define i32 @instructions.win_eh.1() personality i32 -3 {
907 invoke void @f.ccc() to label %normal unwind label %catchswitch1
908 invoke void @f.ccc() to label %normal unwind label %catchswitch2
909 invoke void @f.ccc() to label %normal unwind label %catchswitch3
912 %cs1 = catchswitch within none [label %catchpad1] unwind to caller
915 catchpad within %cs1 []
917 ; CHECK: catchpad within %cs1 []
918 ; CHECK-NEXT: br label %normal
921 %cs2 = catchswitch within none [label %catchpad2] unwind to caller
924 catchpad within %cs2 [i32* %arg1]
926 ; CHECK: catchpad within %cs2 [ptr %arg1]
927 ; CHECK-NEXT: br label %normal
930 %cs3 = catchswitch within none [label %catchpad3] unwind label %cleanuppad1
933 catchpad within %cs3 [i32* %arg1, i32* %arg2]
935 ; CHECK: catchpad within %cs3 [ptr %arg1, ptr %arg2]
936 ; CHECK-NEXT: br label %normal
939 %clean.1 = cleanuppad within none []
941 ; CHECK: %clean.1 = cleanuppad within none []
942 ; CHECK-NEXT: unreachable
948 define i32 @instructions.win_eh.2() personality i32 -4 {
950 invoke void @f.ccc() to label %invoke.cont unwind label %catchswitch
953 invoke void @f.ccc() to label %continue unwind label %cleanup
956 %clean = cleanuppad within none []
957 ; CHECK: %clean = cleanuppad within none []
958 cleanupret from %clean unwind to caller
959 ; CHECK: cleanupret from %clean unwind to caller
962 %cs = catchswitch within none [label %catchpad] unwind label %terminate
965 %catch = catchpad within %cs []
967 ; CHECK: %catch = catchpad within %cs []
968 ; CHECK-NEXT: br label %body
971 invoke void @f.ccc() [ "funclet"(token %catch) ]
972 to label %continue unwind label %terminate.inner
973 catchret from %catch to label %return
974 ; CHECK: catchret from %catch to label %return
980 cleanuppad within %catch []
982 ; CHECK: cleanuppad within %catch []
983 ; CHECK-NEXT: unreachable
986 cleanuppad within none []
988 ; CHECK: cleanuppad within none []
989 ; CHECK-NEXT: unreachable
995 ; Instructions -- Binary Operations
996 define void @instructions.binops(i8 %op1, i8 %op2) {
999 ; CHECK: add i8 %op1, %op2
1000 add nuw i8 %op1, %op2
1001 ; CHECK: add nuw i8 %op1, %op2
1002 add nsw i8 %op1, %op2
1003 ; CHECK: add nsw i8 %op1, %op2
1004 add nuw nsw i8 %op1, %op2
1005 ; CHECK: add nuw nsw i8 %op1, %op2
1007 ; CHECK: sub i8 %op1, %op2
1008 sub nuw i8 %op1, %op2
1009 ; CHECK: sub nuw i8 %op1, %op2
1010 sub nsw i8 %op1, %op2
1011 ; CHECK: sub nsw i8 %op1, %op2
1012 sub nuw nsw i8 %op1, %op2
1013 ; CHECK: sub nuw nsw i8 %op1, %op2
1015 ; CHECK: mul i8 %op1, %op2
1016 mul nuw i8 %op1, %op2
1017 ; CHECK: mul nuw i8 %op1, %op2
1018 mul nsw i8 %op1, %op2
1019 ; CHECK: mul nsw i8 %op1, %op2
1020 mul nuw nsw i8 %op1, %op2
1021 ; CHECK: mul nuw nsw i8 %op1, %op2
1025 ; CHECK: udiv i8 %op1, %op2
1026 udiv exact i8 %op1, %op2
1027 ; CHECK: udiv exact i8 %op1, %op2
1029 ; CHECK: sdiv i8 %op1, %op2
1030 sdiv exact i8 %op1, %op2
1031 ; CHECK: sdiv exact i8 %op1, %op2
1035 ; CHECK: urem i8 %op1, %op2
1037 ; CHECK: srem i8 %op1, %op2
1042 ; Instructions -- Bitwise Binary Operations
1043 define void @instructions.bitwise_binops(i8 %op1, i8 %op2) {
1046 ; CHECK: shl i8 %op1, %op2
1047 shl nuw i8 %op1, %op2
1048 ; CHECK: shl nuw i8 %op1, %op2
1049 shl nsw i8 %op1, %op2
1050 ; CHECK: shl nsw i8 %op1, %op2
1051 shl nuw nsw i8 %op1, %op2
1052 ; CHECK: shl nuw nsw i8 %op1, %op2
1056 ; CHECK: lshr i8 %op1, %op2
1057 lshr exact i8 %op1, %op2
1058 ; CHECK: lshr exact i8 %op1, %op2
1060 ; CHECK: ashr i8 %op1, %op2
1061 ashr exact i8 %op1, %op2
1062 ; CHECK: ashr exact i8 %op1, %op2
1066 ; CHECK: and i8 %op1, %op2
1068 ; CHECK: or i8 %op1, %op2
1070 ; CHECK: xor i8 %op1, %op2
1075 ; Instructions -- Vector Operations
1076 define void @instructions.vectorops(<4 x float> %vec, <4 x float> %vec2) {
1077 extractelement <4 x float> %vec, i8 0
1078 ; CHECK: extractelement <4 x float> %vec, i8 0
1079 insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1080 ; CHECK: insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1081 shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1082 ; CHECK: shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1087 ; Instructions -- Aggregate Operations
1088 define void @instructions.aggregateops({ i8, i32 } %up, <{ i8, i32 }> %p,
1089 [3 x i8] %arr, { i8, { i32 }} %n,
1090 <2 x i8*> %pvec, <2 x i64> %offsets) {
1091 extractvalue { i8, i32 } %up, 0
1092 ; CHECK: extractvalue { i8, i32 } %up, 0
1093 extractvalue <{ i8, i32 }> %p, 1
1094 ; CHECK: extractvalue <{ i8, i32 }> %p, 1
1095 extractvalue [3 x i8] %arr, 2
1096 ; CHECK: extractvalue [3 x i8] %arr, 2
1097 extractvalue { i8, { i32 } } %n, 1, 0
1098 ; CHECK: extractvalue { i8, { i32 } } %n, 1, 0
1100 insertvalue { i8, i32 } %up, i8 1, 0
1101 ; CHECK: insertvalue { i8, i32 } %up, i8 1, 0
1102 insertvalue <{ i8, i32 }> %p, i32 2, 1
1103 ; CHECK: insertvalue <{ i8, i32 }> %p, i32 2, 1
1104 insertvalue [3 x i8] %arr, i8 0, 0
1105 ; CHECK: insertvalue [3 x i8] %arr, i8 0, 0
1106 insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1107 ; CHECK: insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1109 %up.ptr = alloca { i8, i32 }
1110 %p.ptr = alloca <{ i8, i32 }>
1111 %arr.ptr = alloca [3 x i8]
1112 %n.ptr = alloca { i8, { i32 } }
1114 getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
1115 ; CHECK: getelementptr { i8, i32 }, ptr %up.ptr, i8 0
1116 getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
1117 ; CHECK: getelementptr <{ i8, i32 }>, ptr %p.ptr, i8 1
1118 getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
1119 ; CHECK: getelementptr [3 x i8], ptr %arr.ptr, i8 2
1120 getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
1121 ; CHECK: getelementptr { i8, { i32 } }, ptr %n.ptr, i32 0, i32 1
1122 getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
1123 ; CHECK: getelementptr inbounds { i8, { i32 } }, ptr %n.ptr, i32 1, i32 0
1124 getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
1125 ; CHECK: getelementptr i8, <2 x ptr> %pvec, <2 x i64> %offsets
1130 ; Instructions -- Memory Access and Addressing Operations
1134 define void @instructions.memops(i32** %base) {
1135 alloca i32, i8 4, align 4
1136 ; CHECK: alloca i32, i8 4, align 4
1137 alloca inalloca i32, i8 4, align 4
1138 ; CHECK: alloca inalloca i32, i8 4, align 4
1140 load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1141 ; CHECK: load ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1142 load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1143 ; CHECK: load volatile ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1145 store i32* null, i32** %base, align 4, !nontemporal !8
1146 ; CHECK: store ptr null, ptr %base, align 4, !nontemporal !8
1147 store volatile i32* null, i32** %base, align 4, !nontemporal !8
1148 ; CHECK: store volatile ptr null, ptr %base, align 4, !nontemporal !8
1153 ; Instructions -- Conversion Operations
1154 define void @instructions.conversions() {
1156 ; CHECK: trunc i32 -1 to i1
1158 ; CHECK: zext i32 -1 to i64
1160 ; CHECK: sext i32 -1 to i64
1161 fptrunc float undef to half
1162 ; CHECK: fptrunc float undef to half
1163 fpext half undef to float
1164 ; CHECK: fpext half undef to float
1165 fptoui float undef to i32
1166 ; CHECK: fptoui float undef to i32
1167 fptosi float undef to i32
1168 ; CHECK: fptosi float undef to i32
1169 uitofp i32 1 to float
1170 ; CHECK: uitofp i32 1 to float
1171 sitofp i32 -1 to float
1172 ; CHECK: sitofp i32 -1 to float
1173 ptrtoint i8* null to i64
1174 ; CHECK: ptrtoint ptr null to i64
1175 inttoptr i64 0 to i8*
1176 ; CHECK: inttoptr i64 0 to ptr
1177 bitcast i32 0 to i32
1178 ; CHECK: bitcast i32 0 to i32
1179 addrspacecast i32* null to i32 addrspace(1)*
1180 ; CHECK: addrspacecast ptr null to ptr addrspace(1)
1185 ; Instructions -- Other Operations
1186 define void @instructions.other(i32 %op1, i32 %op2, half %fop1, half %fop2) {
1188 icmp eq i32 %op1, %op2
1189 ; CHECK: icmp eq i32 %op1, %op2
1190 icmp ne i32 %op1, %op2
1191 ; CHECK: icmp ne i32 %op1, %op2
1192 icmp ugt i32 %op1, %op2
1193 ; CHECK: icmp ugt i32 %op1, %op2
1194 icmp uge i32 %op1, %op2
1195 ; CHECK: icmp uge i32 %op1, %op2
1196 icmp ult i32 %op1, %op2
1197 ; CHECK: icmp ult i32 %op1, %op2
1198 icmp ule i32 %op1, %op2
1199 ; CHECK: icmp ule i32 %op1, %op2
1200 icmp sgt i32 %op1, %op2
1201 ; CHECK: icmp sgt i32 %op1, %op2
1202 icmp sge i32 %op1, %op2
1203 ; CHECK: icmp sge i32 %op1, %op2
1204 icmp slt i32 %op1, %op2
1205 ; CHECK: icmp slt i32 %op1, %op2
1206 icmp sle i32 %op1, %op2
1207 ; CHECK: icmp sle i32 %op1, %op2
1209 fcmp false half %fop1, %fop2
1210 ; CHECK: fcmp false half %fop1, %fop2
1211 fcmp oeq half %fop1, %fop2
1212 ; CHECK: fcmp oeq half %fop1, %fop2
1213 fcmp ogt half %fop1, %fop2
1214 ; CHECK: fcmp ogt half %fop1, %fop2
1215 fcmp oge half %fop1, %fop2
1216 ; CHECK: fcmp oge half %fop1, %fop2
1217 fcmp olt half %fop1, %fop2
1218 ; CHECK: fcmp olt half %fop1, %fop2
1219 fcmp ole half %fop1, %fop2
1220 ; CHECK: fcmp ole half %fop1, %fop2
1221 fcmp one half %fop1, %fop2
1222 ; CHECK: fcmp one half %fop1, %fop2
1223 fcmp ord half %fop1, %fop2
1224 ; CHECK: fcmp ord half %fop1, %fop2
1225 fcmp ueq half %fop1, %fop2
1226 ; CHECK: fcmp ueq half %fop1, %fop2
1227 fcmp ugt half %fop1, %fop2
1228 ; CHECK: fcmp ugt half %fop1, %fop2
1229 fcmp uge half %fop1, %fop2
1230 ; CHECK: fcmp uge half %fop1, %fop2
1231 fcmp ult half %fop1, %fop2
1232 ; CHECK: fcmp ult half %fop1, %fop2
1233 fcmp ule half %fop1, %fop2
1234 ; CHECK: fcmp ule half %fop1, %fop2
1235 fcmp une half %fop1, %fop2
1236 ; CHECK: fcmp une half %fop1, %fop2
1237 fcmp uno half %fop1, %fop2
1238 ; CHECK: fcmp uno half %fop1, %fop2
1239 fcmp true half %fop1, %fop2
1240 ; CHECK: fcmp true half %fop1, %fop2
1244 %v1 = add i32 %op1, %op2
1247 %v2 = add i32 %op1, %op2
1250 phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1251 ; CHECK: phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1253 select i1 true, i32 0, i32 1
1254 ; CHECK: select i1 true, i32 0, i32 1
1255 select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1256 ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1258 call void @f.nobuiltin() builtin
1259 ; CHECK: call void @f.nobuiltin() #44
1261 ; When used in a non-strictfp function the strictfp callsite attribute
1262 ; should get translated to nobuiltin.
1263 call void @f.strictfp() strictfp
1264 ; CHECK: call void @f.strictfp() #9
1266 call fastcc noalias i32* @f.noalias() noinline
1267 ; CHECK: call fastcc noalias ptr @f.noalias() #12
1268 tail call ghccc nonnull i32* @f.nonnull() minsize
1269 ; CHECK: tail call ghccc nonnull ptr @f.nonnull() #7
1274 define void @instructions.call_musttail(i8* inalloca %val) {
1275 musttail call void @f.param.inalloca(i8* inalloca %val)
1276 ; CHECK: musttail call void @f.param.inalloca(ptr inalloca(i8) %val)
1281 define void @instructions.call_notail() {
1282 notail call void @f1()
1283 ; CHECK: notail call void @f1()
1288 define void @instructions.landingpad() personality i32 -2 {
1289 invoke void @llvm.donothing() to label %proceed unwind label %catch1
1290 invoke void @llvm.donothing() to label %proceed unwind label %catch2
1291 invoke void @llvm.donothing() to label %proceed unwind label %catch3
1292 invoke void @llvm.donothing() to label %proceed unwind label %catch4
1296 ; CHECK: landingpad i32
1303 ; CHECK: landingpad i32
1307 ; CHECK: catch ptr null
1312 ; CHECK: landingpad i32
1316 ; CHECK: catch ptr null
1318 ; CHECK: catch ptr null
1323 ; CHECK: landingpad i32
1324 filter [2 x i32] zeroinitializer
1325 ; CHECK: filter [2 x i32] zeroinitializer
1332 ;; Intrinsic Functions
1334 ; Intrinsic Functions -- Variable Argument Handling
1335 declare void @llvm.va_start(i8*)
1336 declare void @llvm.va_copy(i8*, i8*)
1337 declare void @llvm.va_end(i8*)
1338 define void @instructions.va_arg(i8* %v, ...) {
1340 %ap2 = bitcast i8** %ap to i8*
1342 call void @llvm.va_start(i8* %ap2)
1343 ; CHECK: call void @llvm.va_start.p0(ptr %ap2)
1345 va_arg i8* %ap2, i32
1346 ; CHECK: va_arg ptr %ap2, i32
1348 call void @llvm.va_copy(i8* %v, i8* %ap2)
1349 ; CHECK: call void @llvm.va_copy.p0(ptr %v, ptr %ap2)
1351 call void @llvm.va_end(i8* %ap2)
1352 ; CHECK: call void @llvm.va_end.p0(ptr %ap2)
1357 ; Intrinsic Functions -- Accurate Garbage Collection
1358 declare void @llvm.gcroot(i8**, i8*)
1359 declare i8* @llvm.gcread(i8*, i8**)
1360 declare void @llvm.gcwrite(i8*, i8*, i8**)
1361 define void @intrinsics.gc() gc "shadow-stack" {
1362 %ptrloc = alloca i8*
1363 call void @llvm.gcroot(i8** %ptrloc, i8* null)
1364 ; CHECK: call void @llvm.gcroot(ptr %ptrloc, ptr null)
1366 call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1367 ; CHECK: call ptr @llvm.gcread(ptr null, ptr %ptrloc)
1370 call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1371 ; CHECK: call void @llvm.gcwrite(ptr %ref, ptr null, ptr %ptrloc)
1376 ; Intrinsic Functions -- Code Generation
1377 declare i8* @llvm.returnaddress(i32)
1378 declare i8* @llvm.frameaddress(i32)
1379 declare i32 @llvm.read_register.i32(metadata)
1380 declare i64 @llvm.read_register.i64(metadata)
1381 declare void @llvm.write_register.i32(metadata, i32)
1382 declare void @llvm.write_register.i64(metadata, i64)
1383 declare i8* @llvm.stacksave()
1384 declare void @llvm.stackrestore(i8*)
1385 declare void @llvm.prefetch(i8*, i32, i32, i32)
1386 declare void @llvm.pcmarker(i32)
1387 declare i64 @llvm.readcyclecounter()
1388 declare void @llvm.clear_cache(i8*, i8*)
1389 declare void @llvm.instrprof_increment(i8*, i64, i32, i32)
1392 define void @intrinsics.codegen() {
1393 call i8* @llvm.returnaddress(i32 1)
1394 ; CHECK: call ptr @llvm.returnaddress(i32 1)
1395 call i8* @llvm.frameaddress(i32 1)
1396 ; CHECK: call ptr @llvm.frameaddress.p0(i32 1)
1398 call i32 @llvm.read_register.i32(metadata !10)
1399 ; CHECK: call i32 @llvm.read_register.i32(metadata !10)
1400 call i64 @llvm.read_register.i64(metadata !10)
1401 ; CHECK: call i64 @llvm.read_register.i64(metadata !10)
1402 call void @llvm.write_register.i32(metadata !10, i32 0)
1403 ; CHECK: call void @llvm.write_register.i32(metadata !10, i32 0)
1404 call void @llvm.write_register.i64(metadata !10, i64 0)
1405 ; CHECK: call void @llvm.write_register.i64(metadata !10, i64 0)
1407 %stack = call i8* @llvm.stacksave()
1408 ; CHECK: %stack = call ptr @llvm.stacksave.p0()
1409 call void @llvm.stackrestore(i8* %stack)
1410 ; CHECK: call void @llvm.stackrestore.p0(ptr %stack)
1412 call void @llvm.prefetch(i8* %stack, i32 0, i32 3, i32 0)
1413 ; CHECK: call void @llvm.prefetch.p0(ptr %stack, i32 0, i32 3, i32 0)
1415 call void @llvm.pcmarker(i32 1)
1416 ; CHECK: call void @llvm.pcmarker(i32 1)
1418 call i64 @llvm.readcyclecounter()
1419 ; CHECK: call i64 @llvm.readcyclecounter()
1421 call void @llvm.clear_cache(i8* null, i8* null)
1422 ; CHECK: call void @llvm.clear_cache(ptr null, ptr null)
1424 call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1425 ; CHECK: call void @llvm.instrprof_increment(ptr null, i64 0, i32 0, i32 0)
1430 declare void @llvm.localescape(...)
1431 declare i8* @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
1432 define void @intrinsics.localescape() {
1433 %static.alloca = alloca i32
1434 call void (...) @llvm.localescape(i32* %static.alloca)
1435 ; CHECK: call void (...) @llvm.localescape(ptr %static.alloca)
1437 call void @intrinsics.localrecover()
1441 define void @intrinsics.localrecover() {
1442 %func = bitcast void ()* @intrinsics.localescape to i8*
1443 %fp = call i8* @llvm.frameaddress(i32 1)
1444 call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1445 ; CHECK: call ptr @llvm.localrecover(ptr %func, ptr %fp, i32 0)
1450 ; We need this function to provide `uses' for some metadata tests.
1451 define void @misc.metadata() {
1452 call void @f1(), !srcloc !11
1453 call void @f1(), !srcloc !12
1454 call void @f1(), !srcloc !13
1455 call void @f1(), !srcloc !14
1459 declare void @op_bundle_callee_0()
1460 declare void @op_bundle_callee_1(i32,i32)
1462 define void @call_with_operand_bundle0(i32* %ptr) {
1463 ; CHECK-LABEL: call_with_operand_bundle0(
1465 %l = load i32, i32* %ptr
1467 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1468 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1472 define void @call_with_operand_bundle1(i32* %ptr) {
1473 ; CHECK-LABEL: call_with_operand_bundle1(
1475 %l = load i32, i32* %ptr
1478 call void @op_bundle_callee_0()
1479 call void @op_bundle_callee_0() [ "foo"() ]
1480 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1481 ; CHECK: @op_bundle_callee_0(){{$}}
1482 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"() ]
1483 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1487 define void @call_with_operand_bundle2(i32* %ptr) {
1488 ; CHECK-LABEL: call_with_operand_bundle2(
1490 call void @op_bundle_callee_0() [ "foo"() ]
1491 ; CHECK: call void @op_bundle_callee_0() [ "foo"() ]
1495 define void @call_with_operand_bundle3(i32* %ptr) {
1496 ; CHECK-LABEL: call_with_operand_bundle3(
1498 %l = load i32, i32* %ptr
1500 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1501 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1505 define void @call_with_operand_bundle4(i32* %ptr) {
1506 ; CHECK-LABEL: call_with_operand_bundle4(
1508 %l = load i32, i32* %ptr
1510 call void @op_bundle_callee_1(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1511 ; CHECK: call void @op_bundle_callee_1(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1515 ; Invoke versions of the above tests:
1518 define void @invoke_with_operand_bundle0(i32* %ptr) personality i8 3 {
1519 ; CHECK-LABEL: @invoke_with_operand_bundle0(
1521 %l = load i32, i32* %ptr
1523 invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ] to label %normal unwind label %exception
1524 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1527 %cleanup = landingpad i8 cleanup
1533 define void @invoke_with_operand_bundle1(i32* %ptr) personality i8 3 {
1534 ; CHECK-LABEL: @invoke_with_operand_bundle1(
1536 %l = load i32, i32* %ptr
1539 invoke void @op_bundle_callee_0() to label %normal unwind label %exception
1540 ; CHECK: invoke void @op_bundle_callee_0(){{$}}
1543 %cleanup = landingpad i8 cleanup
1547 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal1 unwind label %exception1
1548 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1551 %cleanup1 = landingpad i8 cleanup
1555 invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] to label %normal2 unwind label %exception2
1556 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1559 %cleanup2 = landingpad i8 cleanup
1566 define void @invoke_with_operand_bundle2(i32* %ptr) personality i8 3 {
1567 ; CHECK-LABEL: @invoke_with_operand_bundle2(
1569 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal unwind label %exception
1570 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1573 %cleanup = landingpad i8 cleanup
1579 define void @invoke_with_operand_bundle3(i32* %ptr) personality i8 3 {
1580 ; CHECK-LABEL: @invoke_with_operand_bundle3(
1582 %l = load i32, i32* %ptr
1584 invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] to label %normal unwind label %exception
1585 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1588 %cleanup = landingpad i8 cleanup
1594 define void @invoke_with_operand_bundle4(i32* %ptr) personality i8 3 {
1595 ; CHECK-LABEL: @invoke_with_operand_bundle4(
1597 %l = load i32, i32* %ptr
1599 invoke void @op_bundle_callee_1(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1600 to label %normal unwind label %exception
1601 ; CHECK: invoke void @op_bundle_callee_1(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1604 %cleanup = landingpad i8 cleanup
1610 declare void @vaargs_func(...)
1611 define void @invoke_with_operand_bundle_vaarg(i32* %ptr) personality i8 3 {
1612 ; CHECK-LABEL: @invoke_with_operand_bundle_vaarg(
1614 %l = load i32, i32* %ptr
1616 invoke void (...) @vaargs_func(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1617 to label %normal unwind label %exception
1618 ; CHECK: invoke void (...) @vaargs_func(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1621 %cleanup = landingpad i8 cleanup
1628 declare void @f.writeonly() writeonly
1629 ; CHECK: declare void @f.writeonly() #41
1631 declare void @f.speculatable() speculatable
1632 ; CHECK: declare void @f.speculatable() #42
1634 ;; Constant Expressions
1636 define i8** @constexpr() {
1637 ; CHECK: ret ptr getelementptr inbounds ({ [4 x ptr], [4 x ptr] }, ptr null, i32 0, i32 1, i32 2)
1638 ret i8** getelementptr inbounds ({ [4 x i8*], [4 x i8*] }, { [4 x i8*], [4 x i8*] }* null, i32 0, inrange i32 1, i32 2)
1641 ; CHECK: attributes #0 = { alignstack=4 }
1642 ; CHECK: attributes #1 = { alignstack=8 }
1643 ; CHECK: attributes #2 = { alwaysinline }
1644 ; CHECK: attributes #3 = { cold }
1645 ; CHECK: attributes #4 = { convergent }
1646 ; CHECK: attributes #5 = { inlinehint }
1647 ; CHECK: attributes #6 = { jumptable }
1648 ; CHECK: attributes #7 = { minsize }
1649 ; CHECK: attributes #8 = { naked }
1650 ; CHECK: attributes #9 = { nobuiltin }
1651 ; CHECK: attributes #10 = { noduplicate }
1652 ; CHECK: attributes #11 = { noimplicitfloat }
1653 ; CHECK: attributes #12 = { noinline }
1654 ; CHECK: attributes #13 = { nonlazybind }
1655 ; CHECK: attributes #14 = { noredzone }
1656 ; CHECK: attributes #15 = { noreturn }
1657 ; CHECK: attributes #16 = { nounwind }
1658 ; CHECK: attributes #17 = { noinline optnone }
1659 ; CHECK: attributes #18 = { optsize }
1660 ; CHECK: attributes #19 = { memory(none) }
1661 ; CHECK: attributes #20 = { memory(read) }
1662 ; CHECK: attributes #21 = { returns_twice }
1663 ; CHECK: attributes #22 = { safestack }
1664 ; CHECK: attributes #23 = { sanitize_address }
1665 ; CHECK: attributes #24 = { sanitize_memory }
1666 ; CHECK: attributes #25 = { sanitize_thread }
1667 ; CHECK: attributes #26 = { ssp }
1668 ; CHECK: attributes #27 = { sspreq }
1669 ; CHECK: attributes #28 = { sspstrong }
1670 ; CHECK: attributes #29 = { "thunk" }
1671 ; CHECK: attributes #30 = { uwtable }
1672 ; CHECK: attributes #31 = { "cpu"="cortex-a8" }
1673 ; CHECK: attributes #32 = { norecurse }
1674 ; CHECK: attributes #33 = { memory(inaccessiblemem: readwrite) }
1675 ; CHECK: attributes #34 = { memory(argmem: readwrite, inaccessiblemem: readwrite) }
1676 ; CHECK: attributes #35 = { nocallback nofree nosync nounwind willreturn memory(none) }
1677 ; CHECK: attributes #36 = { nounwind memory(argmem: read) }
1678 ; CHECK: attributes #37 = { nounwind memory(argmem: readwrite) }
1679 ; CHECK: attributes #38 = { nocallback nofree nosync nounwind willreturn memory(read) }
1680 ; CHECK: attributes #39 = { nocallback nounwind }
1681 ; CHECK: attributes #40 = { nocallback nofree nosync nounwind willreturn }
1682 ; CHECK: attributes #41 = { memory(write) }
1683 ; CHECK: attributes #42 = { speculatable }
1684 ; CHECK: attributes #43 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
1685 ; CHECK: attributes #44 = { builtin }
1689 ; Metadata -- Module flags
1690 !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1691 ; CHECK: !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1693 !0 = !{i32 1, !"mod1", i32 0}
1694 ; CHECK: !0 = !{i32 1, !"mod1", i32 0}
1695 !1 = !{i32 2, !"mod2", i32 0}
1696 ; CHECK: !1 = !{i32 2, !"mod2", i32 0}
1697 !2 = !{i32 3, !"mod3", !3}
1698 ; CHECK: !2 = !{i32 3, !"mod3", !3}
1700 ; CHECK: !3 = !{!"mod6", !0}
1701 !4 = !{i32 4, !"mod4", i32 0}
1702 ; CHECK: !4 = !{i32 4, !"mod4", i32 0}
1703 !5 = !{i32 5, !"mod5", !0}
1704 ; CHECK: !5 = !{i32 5, !"mod5", !0}
1705 !6 = !{i32 6, !"mod6", !0}
1706 ; CHECK: !6 = !{i32 6, !"mod6", !0}
1708 ; Metadata -- Check `distinct'
1710 ; CHECK: !11 = distinct !{}
1712 ; CHECK: !12 = distinct !{}
1714 ; CHECK: !13 = !{!11}
1716 ; CHECK: !14 = !{!12}