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: opt -verify -disable-output < %s.bc
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 noduplicates
27 ; CHECK: $comdat.noduplicates = comdat noduplicates
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 i8* 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 }>
49 ; CHECK: @constant.array.i8 = constant [3 x i8] c"\00\01\00"
50 @constant.array.i8 = constant [3 x i8] [i8 -0, i8 1, i8 0]
51 ; CHECK: @constant.array.i16 = constant [3 x i16] [i16 0, i16 1, i16 0]
52 @constant.array.i16 = constant [3 x i16] [i16 -0, i16 1, i16 0]
53 ; CHECK: @constant.array.i32 = constant [3 x i32] [i32 0, i32 1, i32 0]
54 @constant.array.i32 = constant [3 x i32] [i32 -0, i32 1, i32 0]
55 ; CHECK: @constant.array.i64 = constant [3 x i64] [i64 0, i64 1, i64 0]
56 @constant.array.i64 = constant [3 x i64] [i64 -0, i64 1, i64 0]
57 ; CHECK: @constant.array.f16 = constant [3 x half] [half 0xH8000, half 0xH3C00, half 0xH0000]
58 @constant.array.f16 = constant [3 x half] [half -0.0, half 1.0, half 0.0]
59 ; CHECK: @constant.array.f32 = constant [3 x float] [float -0.000000e+00, float 1.000000e+00, float 0.000000e+00]
60 @constant.array.f32 = constant [3 x float] [float -0.0, float 1.0, float 0.0]
61 ; CHECK: @constant.array.f64 = constant [3 x double] [double -0.000000e+00, double 1.000000e+00, double 0.000000e+00]
62 @constant.array.f64 = constant [3 x double] [double -0.0, double 1.0, double 0.0]
64 ; CHECK: @constant.vector.i8 = constant <3 x i8> <i8 0, i8 1, i8 0>
65 @constant.vector.i8 = constant <3 x i8> <i8 -0, i8 1, i8 0>
66 ; CHECK: @constant.vector.i16 = constant <3 x i16> <i16 0, i16 1, i16 0>
67 @constant.vector.i16 = constant <3 x i16> <i16 -0, i16 1, i16 0>
68 ; CHECK: @constant.vector.i32 = constant <3 x i32> <i32 0, i32 1, i32 0>
69 @constant.vector.i32 = constant <3 x i32> <i32 -0, i32 1, i32 0>
70 ; CHECK: @constant.vector.i64 = constant <3 x i64> <i64 0, i64 1, i64 0>
71 @constant.vector.i64 = constant <3 x i64> <i64 -0, i64 1, i64 0>
72 ; CHECK: @constant.vector.f16 = constant <3 x half> <half 0xH8000, half 0xH3C00, half 0xH0000>
73 @constant.vector.f16 = constant <3 x half> <half -0.0, half 1.0, half 0.0>
74 ; CHECK: @constant.vector.f32 = constant <3 x float> <float -0.000000e+00, float 1.000000e+00, float 0.000000e+00>
75 @constant.vector.f32 = constant <3 x float> <float -0.0, float 1.0, float 0.0>
76 ; CHECK: @constant.vector.f64 = constant <3 x double> <double -0.000000e+00, double 1.000000e+00, double 0.000000e+00>
77 @constant.vector.f64 = constant <3 x double> <double -0.0, double 1.0, double 0.0>
80 ; Format: [@<GlobalVarName> =] [Linkage] [Visibility] [DLLStorageClass]
81 ; [ThreadLocal] [(unnamed_addr|local_unnamed_addr)] [AddrSpace] [ExternallyInitialized]
82 ; <global | constant> <Type> [<InitializerConstant>]
83 ; [, section "name"] [, comdat [($name)]] [, align <Alignment>]
85 ; Global Variables -- Simple
87 ; CHECK: @g1 = global i32 0
89 ; CHECK: @g2 = constant i32 0
91 ; Global Variables -- Linkage
92 @g.private = private global i32 0
93 ; CHECK: @g.private = private global i32 0
94 @g.internal = internal global i32 0
95 ; CHECK: @g.internal = internal global i32 0
96 @g.available_externally = available_externally global i32 0
97 ; CHECK: @g.available_externally = available_externally global i32 0
98 @g.linkonce = linkonce global i32 0
99 ; CHECK: @g.linkonce = linkonce global i32 0
100 @g.weak = weak global i32 0
101 ; CHECK: @g.weak = weak global i32 0
102 @g.common = common global i32 0
103 ; CHECK: @g.common = common global i32 0
104 @g.appending = appending global [4 x i8] c"test"
105 ; CHECK: @g.appending = appending global [4 x i8] c"test"
106 @g.extern_weak = extern_weak global i32
107 ; CHECK: @g.extern_weak = extern_weak global i32
108 @g.linkonce_odr = linkonce_odr global i32 0
109 ; CHECK: @g.linkonce_odr = linkonce_odr global i32 0
110 @g.weak_odr = weak_odr global i32 0
111 ; CHECK: @g.weak_odr = weak_odr global i32 0
112 @g.external = external global i32
113 ; CHECK: @g.external = external global i32
115 ; Global Variables -- Visibility
116 @g.default = default global i32 0
117 ; CHECK: @g.default = global i32 0
118 @g.hidden = hidden global i32 0
119 ; CHECK: @g.hidden = hidden global i32 0
120 @g.protected = protected global i32 0
121 ; CHECK: @g.protected = protected global i32 0
123 ; Global Variables -- DLLStorageClass
124 @g.dlldefault = default global i32 0
125 ; CHECK: @g.dlldefault = global i32 0
126 @g.dllimport = external dllimport global i32
127 ; CHECK: @g.dllimport = external dllimport global i32
128 @g.dllexport = dllexport global i32 0
129 ; CHECK: @g.dllexport = dllexport global i32 0
131 ; Global Variables -- ThreadLocal
132 @g.notthreadlocal = global i32 0
133 ; CHECK: @g.notthreadlocal = global i32 0
134 @g.generaldynamic = thread_local global i32 0
135 ; CHECK: @g.generaldynamic = thread_local global i32 0
136 @g.localdynamic = thread_local(localdynamic) global i32 0
137 ; CHECK: @g.localdynamic = thread_local(localdynamic) global i32 0
138 @g.initialexec = thread_local(initialexec) global i32 0
139 ; CHECK: @g.initialexec = thread_local(initialexec) global i32 0
140 @g.localexec = thread_local(localexec) global i32 0
141 ; CHECK: @g.localexec = thread_local(localexec) global i32 0
143 ; Global Variables -- unnamed_addr and local_unnamed_addr
144 @g.unnamed_addr = unnamed_addr global i32 0
145 ; CHECK: @g.unnamed_addr = unnamed_addr global i32 0
146 @g.local_unnamed_addr = local_unnamed_addr global i32 0
147 ; CHECK: @g.local_unnamed_addr = local_unnamed_addr global i32 0
149 ; Global Variables -- AddrSpace
150 @g.addrspace = addrspace(1) global i32 0
151 ; CHECK: @g.addrspace = addrspace(1) global i32 0
153 ; Global Variables -- ExternallyInitialized
154 @g.externally_initialized = external externally_initialized global i32
155 ; CHECK: @g.externally_initialized = external externally_initialized global i32
157 ; Global Variables -- section
158 @g.section = global i32 0, section "_DATA"
159 ; CHECK: @g.section = global i32 0, section "_DATA"
161 ; Global Variables -- comdat
162 @comdat.any = global i32 0, comdat
163 ; CHECK: @comdat.any = global i32 0, comdat
164 @comdat.exactmatch = global i32 0, comdat
165 ; CHECK: @comdat.exactmatch = global i32 0, comdat
166 @comdat.largest = global i32 0, comdat
167 ; CHECK: @comdat.largest = global i32 0, comdat
168 @comdat.noduplicates = global i32 0, comdat
169 ; CHECK: @comdat.noduplicates = global i32 0, comdat
170 @comdat.samesize = global i32 0, comdat
171 ; CHECK: @comdat.samesize = global i32 0, comdat
173 ; Force two globals from different comdats into sections with the same name.
174 $comdat1 = comdat any
175 $comdat2 = comdat any
176 @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
177 ; CHECK: @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
178 @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
179 ; CHECK: @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
181 ; Global Variables -- align
182 @g.align = global i32 0, align 4
183 ; CHECK: @g.align = global i32 0, align 4
185 ; Global Variables -- Intrinsics
186 %pri.func.data = type { i32, void ()*, i8* }
187 @g.used1 = global i32 0
188 @g.used2 = global i32 0
189 @g.used3 = global i8 0
191 @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
192 ; CHECK: @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
193 @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
194 ; CHECK: @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
195 @llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
196 ; CHECK: @llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
197 @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
198 ; CHECK: @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
201 ; Format: @<Name> = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
202 ; [unnamed_addr] alias <AliaseeTy> @<Aliasee>
205 @a.private = private alias i32, i32* @g.private
206 ; CHECK: @a.private = private alias i32, i32* @g.private
207 @a.internal = internal alias i32, i32* @g.internal
208 ; CHECK: @a.internal = internal alias i32, i32* @g.internal
209 @a.linkonce = linkonce alias i32, i32* @g.linkonce
210 ; CHECK: @a.linkonce = linkonce alias i32, i32* @g.linkonce
211 @a.weak = weak alias i32, i32* @g.weak
212 ; CHECK: @a.weak = weak alias i32, i32* @g.weak
213 @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
214 ; CHECK: @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
215 @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
216 ; CHECK: @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
217 @a.external = external alias i32, i32* @g1
218 ; CHECK: @a.external = alias i32, i32* @g1
220 ; Aliases -- Visibility
221 @a.default = default alias i32, i32* @g.default
222 ; CHECK: @a.default = alias i32, i32* @g.default
223 @a.hidden = hidden alias i32, i32* @g.hidden
224 ; CHECK: @a.hidden = hidden alias i32, i32* @g.hidden
225 @a.protected = protected alias i32, i32* @g.protected
226 ; CHECK: @a.protected = protected alias i32, i32* @g.protected
228 ; Aliases -- DLLStorageClass
229 @a.dlldefault = default alias i32, i32* @g.dlldefault
230 ; CHECK: @a.dlldefault = alias i32, i32* @g.dlldefault
231 @a.dllexport = dllexport alias i32, i32* @g.dllexport
232 ; CHECK: @a.dllexport = dllexport alias i32, i32* @g.dllexport
234 ; Aliases -- ThreadLocal
235 @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
236 ; CHECK: @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
237 @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
238 ; CHECK: @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
239 @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
240 ; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
241 @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
242 ; CHECK: @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
243 @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
244 ; CHECK: @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
246 ; Aliases -- unnamed_addr and local_unnamed_addr
247 @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
248 ; CHECK: @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
249 @a.local_unnamed_addr = local_unnamed_addr alias i32, i32* @g.local_unnamed_addr
250 ; CHECK: @a.local_unnamed_addr = local_unnamed_addr alias i32, i32* @g.local_unnamed_addr
253 ; Format @<Name> = [Linkage] [Visibility] ifunc <IFuncTy>,
254 ; <ResolverTy>* @<Resolver>
257 @ifunc.external = external ifunc void (), i8* ()* @ifunc_resolver
258 ; CHECK: @ifunc.external = ifunc void (), i8* ()* @ifunc_resolver
259 @ifunc.private = private ifunc void (), i8* ()* @ifunc_resolver
260 ; CHECK: @ifunc.private = private ifunc void (), i8* ()* @ifunc_resolver
261 @ifunc.internal = internal ifunc void (), i8* ()* @ifunc_resolver
262 ; CHECK: @ifunc.internal = internal ifunc void (), i8* ()* @ifunc_resolver
264 ; IFunc -- Visibility
265 @ifunc.default = default ifunc void (), i8* ()* @ifunc_resolver
266 ; CHECK: @ifunc.default = ifunc void (), i8* ()* @ifunc_resolver
267 @ifunc.hidden = hidden ifunc void (), i8* ()* @ifunc_resolver
268 ; CHECK: @ifunc.hidden = hidden ifunc void (), i8* ()* @ifunc_resolver
269 @ifunc.protected = protected ifunc void (), i8* ()* @ifunc_resolver
270 ; CHECK: @ifunc.protected = protected ifunc void (), i8* ()* @ifunc_resolver
272 define i8* @ifunc_resolver() {
278 ; Format: define [linkage] [visibility] [DLLStorageClass]
279 ; [cconv] [ret attrs]
280 ; <ResultType> @<FunctionName> ([argument list])
281 ; [(unnamed_addr|local_unnamed_addr)] [fn Attrs] [section "name"] [comdat [($name)]]
282 ; [align N] [gc] [prefix Constant] [prologue Constant]
283 ; [personality Constant] { ... }
285 ; Functions -- Simple
287 ; CHECK: declare void @f1()
290 ; CHECK: define void @f2()
295 ; Functions -- linkage
296 define private void @f.private() {
297 ; CHECK: define private void @f.private()
301 define internal void @f.internal() {
302 ; CHECK: define internal void @f.internal()
306 define available_externally void @f.available_externally() {
307 ; CHECK: define available_externally void @f.available_externally()
311 define linkonce void @f.linkonce() {
312 ; CHECK: define linkonce void @f.linkonce()
316 define weak void @f.weak() {
317 ; CHECK: define weak void @f.weak()
321 define linkonce_odr void @f.linkonce_odr() {
322 ; CHECK: define linkonce_odr void @f.linkonce_odr()
326 define weak_odr void @f.weak_odr() {
327 ; CHECK: define weak_odr void @f.weak_odr()
331 declare external void @f.external()
332 ; CHECK: declare void @f.external()
333 declare extern_weak void @f.extern_weak()
334 ; CHECK: declare extern_weak void @f.extern_weak()
336 ; Functions -- visibility
337 declare default void @f.default()
338 ; CHECK: declare void @f.default()
339 declare hidden void @f.hidden()
340 ; CHECK: declare hidden void @f.hidden()
341 declare protected void @f.protected()
342 ; CHECK: declare protected void @f.protected()
344 ; Functions -- DLLStorageClass
345 declare dllimport void @f.dllimport()
346 ; CHECK: declare dllimport void @f.dllimport()
347 declare dllexport void @f.dllexport()
348 ; CHECK: declare dllexport void @f.dllexport()
350 ; Functions -- cconv (Calling conventions)
351 declare ccc void @f.ccc()
352 ; CHECK: declare void @f.ccc()
353 declare fastcc void @f.fastcc()
354 ; CHECK: declare fastcc void @f.fastcc()
355 declare coldcc void @f.coldcc()
356 ; CHECK: declare coldcc void @f.coldcc()
357 declare cc10 void @f.cc10()
358 ; CHECK: declare ghccc void @f.cc10()
359 declare ghccc void @f.ghccc()
360 ; CHECK: declare ghccc void @f.ghccc()
361 declare cc11 void @f.cc11()
362 ; CHECK: declare cc11 void @f.cc11()
363 declare webkit_jscc void @f.webkit_jscc()
364 ; CHECK: declare webkit_jscc void @f.webkit_jscc()
365 declare anyregcc void @f.anyregcc()
366 ; CHECK: declare anyregcc void @f.anyregcc()
367 declare preserve_mostcc void @f.preserve_mostcc()
368 ; CHECK: declare preserve_mostcc void @f.preserve_mostcc()
369 declare preserve_allcc void @f.preserve_allcc()
370 ; CHECK: declare preserve_allcc void @f.preserve_allcc()
371 declare cc64 void @f.cc64()
372 ; CHECK: declare x86_stdcallcc void @f.cc64()
373 declare x86_stdcallcc void @f.x86_stdcallcc()
374 ; CHECK: declare x86_stdcallcc void @f.x86_stdcallcc()
375 declare cc65 void @f.cc65()
376 ; CHECK: declare x86_fastcallcc void @f.cc65()
377 declare x86_fastcallcc void @f.x86_fastcallcc()
378 ; CHECK: declare x86_fastcallcc void @f.x86_fastcallcc()
379 declare cc66 void @f.cc66()
380 ; CHECK: declare arm_apcscc void @f.cc66()
381 declare arm_apcscc void @f.arm_apcscc()
382 ; CHECK: declare arm_apcscc void @f.arm_apcscc()
383 declare cc67 void @f.cc67()
384 ; CHECK: declare arm_aapcscc void @f.cc67()
385 declare arm_aapcscc void @f.arm_aapcscc()
386 ; CHECK: declare arm_aapcscc void @f.arm_aapcscc()
387 declare cc68 void @f.cc68()
388 ; CHECK: declare arm_aapcs_vfpcc void @f.cc68()
389 declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
390 ; CHECK: declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
391 declare cc69 void @f.cc69()
392 ; CHECK: declare msp430_intrcc void @f.cc69()
393 declare msp430_intrcc void @f.msp430_intrcc()
394 ; CHECK: declare msp430_intrcc void @f.msp430_intrcc()
395 declare cc70 void @f.cc70()
396 ; CHECK: declare x86_thiscallcc void @f.cc70()
397 declare x86_thiscallcc void @f.x86_thiscallcc()
398 ; CHECK: declare x86_thiscallcc void @f.x86_thiscallcc()
399 declare cc71 void @f.cc71()
400 ; CHECK: declare ptx_kernel void @f.cc71()
401 declare ptx_kernel void @f.ptx_kernel()
402 ; CHECK: declare ptx_kernel void @f.ptx_kernel()
403 declare cc72 void @f.cc72()
404 ; CHECK: declare ptx_device void @f.cc72()
405 declare ptx_device void @f.ptx_device()
406 ; CHECK: declare ptx_device void @f.ptx_device()
407 declare cc75 void @f.cc75()
408 ; CHECK: declare spir_func void @f.cc75()
409 declare spir_func void @f.spir_func()
410 ; CHECK: declare spir_func void @f.spir_func()
411 declare cc76 void @f.cc76()
412 ; CHECK: declare spir_kernel void @f.cc76()
413 declare spir_kernel void @f.spir_kernel()
414 ; CHECK: declare spir_kernel void @f.spir_kernel()
415 declare cc77 void @f.cc77()
416 ; CHECK: declare intel_ocl_bicc void @f.cc77()
417 declare intel_ocl_bicc void @f.intel_ocl_bicc()
418 ; CHECK: declare intel_ocl_bicc void @f.intel_ocl_bicc()
419 declare cc78 void @f.cc78()
420 ; CHECK: declare x86_64_sysvcc void @f.cc78()
421 declare x86_64_sysvcc void @f.x86_64_sysvcc()
422 ; CHECK: declare x86_64_sysvcc void @f.x86_64_sysvcc()
423 declare cc79 void @f.cc79()
424 ; CHECK: declare win64cc void @f.cc79()
425 declare win64cc void @f.win64cc()
426 ; CHECK: declare win64cc void @f.win64cc()
427 declare cc80 void @f.cc80()
428 ; CHECK: declare x86_vectorcallcc void @f.cc80()
429 declare x86_vectorcallcc void @f.x86_vectorcallcc()
430 ; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc()
431 declare cc81 void @f.cc81()
432 ; CHECK: declare hhvmcc void @f.cc81()
433 declare hhvmcc void @f.hhvmcc()
434 ; CHECK: declare hhvmcc void @f.hhvmcc()
435 declare cc82 void @f.cc82()
436 ; CHECK: declare hhvm_ccc void @f.cc82()
437 declare hhvm_ccc void @f.hhvm_ccc()
438 ; CHECK: declare hhvm_ccc void @f.hhvm_ccc()
439 declare cc83 void @f.cc83()
440 ; CHECK: declare x86_intrcc void @f.cc83()
441 declare x86_intrcc void @f.x86_intrcc()
442 ; CHECK: declare x86_intrcc void @f.x86_intrcc()
443 declare cc84 void @f.cc84()
444 ; CHECK: declare avr_intrcc void @f.cc84()
445 declare avr_intrcc void @f.avr_intrcc()
446 ; CHECK: declare avr_intrcc void @f.avr_intrcc()
447 declare cc85 void @f.cc85()
448 ; CHECK: declare avr_signalcc void @f.cc85()
449 declare avr_signalcc void @f.avr_signalcc()
450 ; CHECK: declare avr_signalcc void @f.avr_signalcc()
451 declare cc87 void @f.cc87()
452 ; CHECK: declare amdgpu_vs void @f.cc87()
453 declare amdgpu_vs void @f.amdgpu_vs()
454 ; CHECK: declare amdgpu_vs void @f.amdgpu_vs()
455 declare cc88 void @f.cc88()
456 ; CHECK: declare amdgpu_gs void @f.cc88()
457 declare amdgpu_gs void @f.amdgpu_gs()
458 ; CHECK: declare amdgpu_gs void @f.amdgpu_gs()
459 declare cc89 void @f.cc89()
460 ; CHECK: declare amdgpu_ps void @f.cc89()
461 declare amdgpu_ps void @f.amdgpu_ps()
462 ; CHECK: declare amdgpu_ps void @f.amdgpu_ps()
463 declare cc90 void @f.cc90()
464 ; CHECK: declare amdgpu_cs void @f.cc90()
465 declare amdgpu_cs void @f.amdgpu_cs()
466 ; CHECK: declare amdgpu_cs void @f.amdgpu_cs()
467 declare cc91 void @f.cc91()
468 ; CHECK: declare amdgpu_kernel void @f.cc91()
469 declare amdgpu_kernel void @f.amdgpu_kernel()
470 ; CHECK: declare amdgpu_kernel void @f.amdgpu_kernel()
471 declare cc93 void @f.cc93()
472 ; CHECK: declare amdgpu_hs void @f.cc93()
473 declare amdgpu_hs void @f.amdgpu_hs()
474 ; CHECK: declare amdgpu_hs void @f.amdgpu_hs()
475 declare cc95 void @f.cc95()
476 ; CHECK: declare amdgpu_ls void @f.cc95()
477 declare amdgpu_ls void @f.amdgpu_ls()
478 ; CHECK: declare amdgpu_ls void @f.amdgpu_ls()
479 declare cc96 void @f.cc96()
480 ; CHECK: declare amdgpu_es void @f.cc96()
481 declare amdgpu_es void @f.amdgpu_es()
482 ; CHECK: declare amdgpu_es void @f.amdgpu_es()
483 declare cc1023 void @f.cc1023()
484 ; CHECK: declare cc1023 void @f.cc1023()
486 ; Functions -- ret attrs (Return attributes)
487 declare zeroext i64 @f.zeroext()
488 ; CHECK: declare zeroext i64 @f.zeroext()
489 declare signext i64 @f.signext()
490 ; CHECK: declare signext i64 @f.signext()
491 declare inreg i32* @f.inreg()
492 ; CHECK: declare inreg i32* @f.inreg()
493 declare noalias i32* @f.noalias()
494 ; CHECK: declare noalias i32* @f.noalias()
495 declare nonnull i32* @f.nonnull()
496 ; CHECK: declare nonnull i32* @f.nonnull()
497 declare dereferenceable(4) i32* @f.dereferenceable4()
498 ; CHECK: declare dereferenceable(4) i32* @f.dereferenceable4()
499 declare dereferenceable(8) i32* @f.dereferenceable8()
500 ; CHECK: declare dereferenceable(8) i32* @f.dereferenceable8()
501 declare dereferenceable(16) i32* @f.dereferenceable16()
502 ; CHECK: declare dereferenceable(16) i32* @f.dereferenceable16()
503 declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
504 ; CHECK: declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
505 declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
506 ; CHECK: declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
507 declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
508 ; CHECK: declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
510 ; Functions -- Parameter attributes
511 declare void @f.param.zeroext(i8 zeroext)
512 ; CHECK: declare void @f.param.zeroext(i8 zeroext)
513 declare void @f.param.signext(i8 signext)
514 ; CHECK: declare void @f.param.signext(i8 signext)
515 declare void @f.param.inreg(i8 inreg)
516 ; CHECK: declare void @f.param.inreg(i8 inreg)
517 declare void @f.param.byval({ i8, i8 }* byval)
518 ; CHECK: declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
519 declare void @f.param.inalloca(i8* inalloca)
520 ; CHECK: declare void @f.param.inalloca(i8* inalloca)
521 declare void @f.param.sret(i8* sret)
522 ; CHECK: declare void @f.param.sret(i8* sret)
523 declare void @f.param.noalias(i8* noalias)
524 ; CHECK: declare void @f.param.noalias(i8* noalias)
525 declare void @f.param.nocapture(i8* nocapture)
526 ; CHECK: declare void @f.param.nocapture(i8* nocapture)
527 declare void @f.param.nest(i8* nest)
528 ; CHECK: declare void @f.param.nest(i8* nest)
529 declare i8* @f.param.returned(i8* returned)
530 ; CHECK: declare i8* @f.param.returned(i8* returned)
531 declare void @f.param.nonnull(i8* nonnull)
532 ; CHECK: declare void @f.param.nonnull(i8* nonnull)
533 declare void @f.param.dereferenceable(i8* dereferenceable(4))
534 ; CHECK: declare void @f.param.dereferenceable(i8* dereferenceable(4))
535 declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
536 ; CHECK: declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
538 ; Functions -- unnamed_addr and local_unnamed_addr
539 declare void @f.unnamed_addr() unnamed_addr
540 ; CHECK: declare void @f.unnamed_addr() unnamed_addr
541 declare void @f.local_unnamed_addr() local_unnamed_addr
542 ; CHECK: declare void @f.local_unnamed_addr() local_unnamed_addr
544 ; Functions -- fn Attrs (Function attributes)
545 declare void @f.alignstack4() alignstack(4)
546 ; CHECK: declare void @f.alignstack4() #0
547 declare void @f.alignstack8() alignstack(8)
548 ; CHECK: declare void @f.alignstack8() #1
549 declare void @f.alwaysinline() alwaysinline
550 ; CHECK: declare void @f.alwaysinline() #2
551 declare void @f.cold() cold
552 ; CHECK: declare void @f.cold() #3
553 declare void @f.convergent() convergent
554 ; CHECK: declare void @f.convergent() #4
555 declare void @f.inlinehint() inlinehint
556 ; CHECK: declare void @f.inlinehint() #5
557 declare void @f.jumptable() unnamed_addr jumptable
558 ; CHECK: declare void @f.jumptable() unnamed_addr #6
559 declare void @f.minsize() minsize
560 ; CHECK: declare void @f.minsize() #7
561 declare void @f.naked() naked
562 ; CHECK: declare void @f.naked() #8
563 declare void @f.nobuiltin() nobuiltin
564 ; CHECK: declare void @f.nobuiltin() #9
565 declare void @f.noduplicate() noduplicate
566 ; CHECK: declare void @f.noduplicate() #10
567 declare void @f.noimplicitfloat() noimplicitfloat
568 ; CHECK: declare void @f.noimplicitfloat() #11
569 declare void @f.noinline() noinline
570 ; CHECK: declare void @f.noinline() #12
571 declare void @f.nonlazybind() nonlazybind
572 ; CHECK: declare void @f.nonlazybind() #13
573 declare void @f.noredzone() noredzone
574 ; CHECK: declare void @f.noredzone() #14
575 declare void @f.noreturn() noreturn
576 ; CHECK: declare void @f.noreturn() #15
577 declare void @f.nounwind() nounwind
578 ; CHECK: declare void @f.nounwind() #16
579 declare void @f.optnone() noinline optnone
580 ; CHECK: declare void @f.optnone() #17
581 declare void @f.optsize() optsize
582 ; CHECK: declare void @f.optsize() #18
583 declare void @f.readnone() readnone
584 ; CHECK: declare void @f.readnone() #19
585 declare void @f.readonly() readonly
586 ; CHECK: declare void @f.readonly() #20
587 declare void @f.returns_twice() returns_twice
588 ; CHECK: declare void @f.returns_twice() #21
589 declare void @f.safestack() safestack
590 ; CHECK: declare void @f.safestack() #22
591 declare void @f.sanitize_address() sanitize_address
592 ; CHECK: declare void @f.sanitize_address() #23
593 declare void @f.sanitize_memory() sanitize_memory
594 ; CHECK: declare void @f.sanitize_memory() #24
595 declare void @f.sanitize_thread() sanitize_thread
596 ; CHECK: declare void @f.sanitize_thread() #25
597 declare void @f.ssp() ssp
598 ; CHECK: declare void @f.ssp() #26
599 declare void @f.sspreq() sspreq
600 ; CHECK: declare void @f.sspreq() #27
601 declare void @f.sspstrong() sspstrong
602 ; CHECK: declare void @f.sspstrong() #28
603 declare void @f.thunk() "thunk"
604 ; CHECK: declare void @f.thunk() #29
605 declare void @f.uwtable() uwtable
606 ; CHECK: declare void @f.uwtable() #30
607 declare void @f.kvpair() "cpu"="cortex-a8"
608 ; CHECK:declare void @f.kvpair() #31
609 declare void @f.norecurse() norecurse
610 ; CHECK: declare void @f.norecurse() #32
611 declare void @f.inaccessiblememonly() inaccessiblememonly
612 ; CHECK: declare void @f.inaccessiblememonly() #33
613 declare void @f.inaccessiblemem_or_argmemonly() inaccessiblemem_or_argmemonly
614 ; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #34
615 declare void @f.strictfp() #35
617 ; Functions -- section
618 declare void @f.section() section "80"
619 ; CHECK: declare void @f.section() section "80"
621 ; Functions -- comdat
622 define void @f.comdat_any() comdat($comdat.any) {
623 ; CHECK: define void @f.comdat_any() comdat($comdat.any)
627 define void @f.comdat_exactmatch() comdat($comdat.exactmatch) {
628 ; CHECK: define void @f.comdat_exactmatch() comdat($comdat.exactmatch)
632 define void @f.comdat_largest() comdat($comdat.largest) {
633 ; CHECK: define void @f.comdat_largest() comdat($comdat.largest)
637 define void @f.comdat_noduplicates() comdat($comdat.noduplicates) {
638 ; CHECK: define void @f.comdat_noduplicates() comdat($comdat.noduplicates)
642 define void @f.comdat_samesize() comdat($comdat.samesize) {
643 ; CHECK: define void @f.comdat_samesize() comdat($comdat.samesize)
649 declare void @f.align2() align 2
650 ; CHECK: declare void @f.align2() align 2
651 declare void @f.align4() align 4
652 ; CHECK: declare void @f.align4() align 4
653 declare void @f.align8() align 8
654 ; CHECK: declare void @f.align8() align 8
657 declare void @f.gcshadow() gc "shadow-stack"
658 ; CHECK: declare void @f.gcshadow() gc "shadow-stack"
660 ; Functions -- Prefix data
661 declare void @f.prefixi32() prefix i32 1684365668
662 ; CHECK: declare void @f.prefixi32() prefix i32 1684365668
663 declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
664 ; CHECK: declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
666 ; Functions -- Prologue data
667 declare void @f.prologuei32() prologue i32 1684365669
668 ; CHECK: declare void @f.prologuei32() prologue i32 1684365669
669 declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
670 ; CHECK: declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
672 ; Functions -- Personality constant
673 declare void @llvm.donothing() nounwind readnone
674 ; CHECK: declare void @llvm.donothing() #35
675 define void @f.no_personality() personality i8 3 {
676 ; CHECK: define void @f.no_personality() personality i8 3
677 invoke void @llvm.donothing() to label %normal unwind label %exception
679 %cleanup = landingpad i8 cleanup
685 declare i32 @f.personality_handler()
686 ; CHECK: declare i32 @f.personality_handler()
687 define void @f.personality() personality i32 ()* @f.personality_handler {
688 ; CHECK: define void @f.personality() personality i32 ()* @f.personality_handler
689 invoke void @llvm.donothing() to label %normal unwind label %exception
691 %cleanup = landingpad i32 cleanup
697 ;; Atomic Memory Ordering Constraints
698 define void @atomics(i32* %word) {
699 %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
700 ; CHECK: %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
701 %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
702 ; CHECK: %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
703 %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
704 ; CHECK: %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
705 %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
706 ; CHECK: %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
707 %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
708 ; CHECK: %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
709 %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
710 ; CHECK: %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
711 %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
712 ; CHECK: %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
713 %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
714 ; CHECK: %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
715 %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
716 ; CHECK: %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
717 %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic
718 ; CHECK: %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic
719 %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic
720 ; CHECK: %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic
721 %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic
722 ; CHECK: %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic
723 %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic
724 ; CHECK: %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic
725 %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic
726 ; CHECK: %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic
727 %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic
728 ; CHECK: %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic
729 %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic
730 ; CHECK: %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic
731 %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic
732 ; CHECK: %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic
733 %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic
734 ; CHECK: %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic
735 %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic
736 ; CHECK: %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic
738 ; CHECK: fence acquire
740 ; CHECK: fence release
742 ; CHECK: fence acq_rel
743 fence syncscope("singlethread") seq_cst
744 ; CHECK: fence syncscope("singlethread") seq_cst
746 %ld.1 = load atomic i32, i32* %word monotonic, align 4
747 ; CHECK: %ld.1 = load atomic i32, i32* %word monotonic, align 4
748 %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
749 ; CHECK: %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
750 %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16
751 ; CHECK: %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16
753 store atomic i32 23, i32* %word monotonic, align 4
754 ; CHECK: store atomic i32 23, i32* %word monotonic, align 4
755 store atomic volatile i32 24, i32* %word monotonic, align 4
756 ; CHECK: store atomic volatile i32 24, i32* %word monotonic, align 4
757 store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4
758 ; CHECK: store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4
763 define void @fastmathflags(float %op1, float %op2) {
764 %f.nnan = fadd nnan float %op1, %op2
765 ; CHECK: %f.nnan = fadd nnan float %op1, %op2
766 %f.ninf = fadd ninf float %op1, %op2
767 ; CHECK: %f.ninf = fadd ninf float %op1, %op2
768 %f.nsz = fadd nsz float %op1, %op2
769 ; CHECK: %f.nsz = fadd nsz float %op1, %op2
770 %f.arcp = fadd arcp float %op1, %op2
771 ; CHECK: %f.arcp = fadd arcp float %op1, %op2
772 %f.contract = fadd contract float %op1, %op2
773 ; CHECK: %f.contract = fadd contract float %op1, %op2
774 %f.afn = fadd afn float %op1, %op2
775 ; CHECK: %f.afn = fadd afn float %op1, %op2
776 %f.reassoc = fadd reassoc float %op1, %op2
777 ; CHECK: %f.reassoc = fadd reassoc float %op1, %op2
778 %f.fast = fadd fast float %op1, %op2
779 ; CHECK: %f.fast = fadd fast float %op1, %op2
783 ; Check various fast math flags and floating-point types on calls.
785 declare float @fmf1()
786 declare double @fmf2()
787 declare <4 x double> @fmf3()
789 ; CHECK-LABEL: fastMathFlagsForCalls(
790 define void @fastMathFlagsForCalls(float %f, double %d1, <4 x double> %d2) {
791 %call.fast = call fast float @fmf1()
792 ; CHECK: %call.fast = call fast float @fmf1()
794 ; Throw in some other attributes to make sure those stay in the right places.
796 %call.nsz.arcp = notail call nsz arcp double @fmf2()
797 ; CHECK: %call.nsz.arcp = notail call nsz arcp double @fmf2()
799 %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
800 ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
806 %opaquety = type opaque
807 define void @typesystem() {
808 %p0 = bitcast i8* null to i32 (i32)*
809 ; CHECK: %p0 = bitcast i8* null to i32 (i32)*
810 %p1 = bitcast i8* null to void (i8*)*
811 ; CHECK: %p1 = bitcast i8* null to void (i8*)*
812 %p2 = bitcast i8* null to i32 (i8*, ...)*
813 ; CHECK: %p2 = bitcast i8* null to i32 (i8*, ...)*
814 %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
815 ; CHECK: %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
816 %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
817 ; CHECK: %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
818 %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
819 ; CHECK: %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
821 %t0 = alloca i1942652
822 ; CHECK: %t0 = alloca i1942652
824 ; CHECK: %t1 = alloca half
826 ; CHECK: %t2 = alloca float
828 ; CHECK: %t3 = alloca double
830 ; CHECK: %t4 = alloca fp128
831 %t5 = alloca x86_fp80
832 ; CHECK: %t5 = alloca x86_fp80
833 %t6 = alloca ppc_fp128
834 ; CHECK: %t6 = alloca ppc_fp128
836 ; CHECK: %t7 = alloca x86_mmx
837 %t8 = alloca %opaquety*
838 ; CHECK: %t8 = alloca %opaquety*
843 declare void @llvm.token(token)
844 ; CHECK: declare void @llvm.token(token)
846 ;; Inline Assembler Expressions
847 define void @inlineasm(i32 %arg) {
848 call i32 asm "bswap $0", "=r,r"(i32 %arg)
849 ; CHECK: call i32 asm "bswap $0", "=r,r"(i32 %arg)
850 call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
851 ; CHECK: call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
857 ; Instructions -- Terminators
858 define void @instructions.terminators(i8 %val) personality i32 -10 {
859 br i1 false, label %iftrue, label %iffalse
860 ; CHECK: br i1 false, label %iftrue, label %iffalse
862 ; CHECK: br label %iftrue
868 switch i8 %val, label %defaultdest [
869 ; CHECK: switch i8 %val, label %defaultdest [
870 i8 0, label %defaultdest.0
871 ; CHECK: i8 0, label %defaultdest.0
872 i8 1, label %defaultdest.1
873 ; CHECK: i8 1, label %defaultdest.1
874 i8 2, label %defaultdest.2
875 ; CHECK: i8 2, label %defaultdest.2
886 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
887 ; CHECK: indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
888 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
889 ; CHECK: indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
891 invoke fastcc void @f.fastcc()
892 ; CHECK: invoke fastcc void @f.fastcc()
893 to label %defaultdest unwind label %exc
894 ; CHECK: to label %defaultdest unwind label %exc
896 %cleanup = landingpad i32 cleanup
899 ; CHECK: resume i32 undef
906 define i32 @instructions.win_eh.1() personality i32 -3 {
910 invoke void @f.ccc() to label %normal unwind label %catchswitch1
911 invoke void @f.ccc() to label %normal unwind label %catchswitch2
912 invoke void @f.ccc() to label %normal unwind label %catchswitch3
915 %cs1 = catchswitch within none [label %catchpad1] unwind to caller
918 catchpad within %cs1 []
920 ; CHECK: catchpad within %cs1 []
921 ; CHECK-NEXT: br label %normal
924 %cs2 = catchswitch within none [label %catchpad2] unwind to caller
927 catchpad within %cs2 [i32* %arg1]
929 ; CHECK: catchpad within %cs2 [i32* %arg1]
930 ; CHECK-NEXT: br label %normal
933 %cs3 = catchswitch within none [label %catchpad3] unwind label %cleanuppad1
936 catchpad within %cs3 [i32* %arg1, i32* %arg2]
938 ; CHECK: catchpad within %cs3 [i32* %arg1, i32* %arg2]
939 ; CHECK-NEXT: br label %normal
942 %clean.1 = cleanuppad within none []
944 ; CHECK: %clean.1 = cleanuppad within none []
945 ; CHECK-NEXT: unreachable
951 define i32 @instructions.win_eh.2() personality i32 -4 {
953 invoke void @f.ccc() to label %invoke.cont unwind label %catchswitch
956 invoke void @f.ccc() to label %continue unwind label %cleanup
959 %clean = cleanuppad within none []
960 ; CHECK: %clean = cleanuppad within none []
961 cleanupret from %clean unwind to caller
962 ; CHECK: cleanupret from %clean unwind to caller
965 %cs = catchswitch within none [label %catchpad] unwind label %terminate
968 %catch = catchpad within %cs []
970 ; CHECK: %catch = catchpad within %cs []
971 ; CHECK-NEXT: br label %body
974 invoke void @f.ccc() [ "funclet"(token %catch) ]
975 to label %continue unwind label %terminate.inner
976 catchret from %catch to label %return
977 ; CHECK: catchret from %catch to label %return
983 cleanuppad within %catch []
985 ; CHECK: cleanuppad within %catch []
986 ; CHECK-NEXT: unreachable
989 cleanuppad within none []
991 ; CHECK: cleanuppad within none []
992 ; CHECK-NEXT: unreachable
998 ; Instructions -- Binary Operations
999 define void @instructions.binops(i8 %op1, i8 %op2) {
1002 ; CHECK: add i8 %op1, %op2
1003 add nuw i8 %op1, %op2
1004 ; CHECK: add nuw i8 %op1, %op2
1005 add nsw i8 %op1, %op2
1006 ; CHECK: add nsw i8 %op1, %op2
1007 add nuw nsw i8 %op1, %op2
1008 ; CHECK: add nuw nsw i8 %op1, %op2
1010 ; CHECK: sub i8 %op1, %op2
1011 sub nuw i8 %op1, %op2
1012 ; CHECK: sub nuw i8 %op1, %op2
1013 sub nsw i8 %op1, %op2
1014 ; CHECK: sub nsw i8 %op1, %op2
1015 sub nuw nsw i8 %op1, %op2
1016 ; CHECK: sub nuw nsw i8 %op1, %op2
1018 ; CHECK: mul i8 %op1, %op2
1019 mul nuw i8 %op1, %op2
1020 ; CHECK: mul nuw i8 %op1, %op2
1021 mul nsw i8 %op1, %op2
1022 ; CHECK: mul nsw i8 %op1, %op2
1023 mul nuw nsw i8 %op1, %op2
1024 ; CHECK: mul nuw nsw i8 %op1, %op2
1028 ; CHECK: udiv i8 %op1, %op2
1029 udiv exact i8 %op1, %op2
1030 ; CHECK: udiv exact i8 %op1, %op2
1032 ; CHECK: sdiv i8 %op1, %op2
1033 sdiv exact i8 %op1, %op2
1034 ; CHECK: sdiv exact i8 %op1, %op2
1038 ; CHECK: urem i8 %op1, %op2
1040 ; CHECK: srem i8 %op1, %op2
1045 ; Instructions -- Bitwise Binary Operations
1046 define void @instructions.bitwise_binops(i8 %op1, i8 %op2) {
1049 ; CHECK: shl i8 %op1, %op2
1050 shl nuw i8 %op1, %op2
1051 ; CHECK: shl nuw i8 %op1, %op2
1052 shl nsw i8 %op1, %op2
1053 ; CHECK: shl nsw i8 %op1, %op2
1054 shl nuw nsw i8 %op1, %op2
1055 ; CHECK: shl nuw nsw i8 %op1, %op2
1059 ; CHECK: lshr i8 %op1, %op2
1060 lshr exact i8 %op1, %op2
1061 ; CHECK: lshr exact i8 %op1, %op2
1063 ; CHECK: ashr i8 %op1, %op2
1064 ashr exact i8 %op1, %op2
1065 ; CHECK: ashr exact i8 %op1, %op2
1069 ; CHECK: and i8 %op1, %op2
1071 ; CHECK: or i8 %op1, %op2
1073 ; CHECK: xor i8 %op1, %op2
1078 ; Instructions -- Vector Operations
1079 define void @instructions.vectorops(<4 x float> %vec, <4 x float> %vec2) {
1080 extractelement <4 x float> %vec, i8 0
1081 ; CHECK: extractelement <4 x float> %vec, i8 0
1082 insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1083 ; CHECK: insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1084 shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1085 ; CHECK: shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1090 ; Instructions -- Aggregate Operations
1091 define void @instructions.aggregateops({ i8, i32 } %up, <{ i8, i32 }> %p,
1092 [3 x i8] %arr, { i8, { i32 }} %n,
1093 <2 x i8*> %pvec, <2 x i64> %offsets) {
1094 extractvalue { i8, i32 } %up, 0
1095 ; CHECK: extractvalue { i8, i32 } %up, 0
1096 extractvalue <{ i8, i32 }> %p, 1
1097 ; CHECK: extractvalue <{ i8, i32 }> %p, 1
1098 extractvalue [3 x i8] %arr, 2
1099 ; CHECK: extractvalue [3 x i8] %arr, 2
1100 extractvalue { i8, { i32 } } %n, 1, 0
1101 ; CHECK: extractvalue { i8, { i32 } } %n, 1, 0
1103 insertvalue { i8, i32 } %up, i8 1, 0
1104 ; CHECK: insertvalue { i8, i32 } %up, i8 1, 0
1105 insertvalue <{ i8, i32 }> %p, i32 2, 1
1106 ; CHECK: insertvalue <{ i8, i32 }> %p, i32 2, 1
1107 insertvalue [3 x i8] %arr, i8 0, 0
1108 ; CHECK: insertvalue [3 x i8] %arr, i8 0, 0
1109 insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1110 ; CHECK: insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1112 %up.ptr = alloca { i8, i32 }
1113 %p.ptr = alloca <{ i8, i32 }>
1114 %arr.ptr = alloca [3 x i8]
1115 %n.ptr = alloca { i8, { i32 } }
1117 getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
1118 ; CHECK: getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
1119 getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
1120 ; CHECK: getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
1121 getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
1122 ; CHECK: getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
1123 getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
1124 ; CHECK: getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
1125 getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
1126 ; CHECK: getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
1127 getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
1128 ; CHECK: getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
1133 ; Instructions -- Memory Access and Addressing Operations
1137 define void @instructions.memops(i32** %base) {
1138 alloca i32, i8 4, align 4
1139 ; CHECK: alloca i32, i8 4, align 4
1140 alloca inalloca i32, i8 4, align 4
1141 ; CHECK: alloca inalloca i32, i8 4, align 4
1143 load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1144 ; CHECK: load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1145 load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1146 ; CHECK: load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1148 store i32* null, i32** %base, align 4, !nontemporal !8
1149 ; CHECK: store i32* null, i32** %base, align 4, !nontemporal !8
1150 store volatile i32* null, i32** %base, align 4, !nontemporal !8
1151 ; CHECK: store volatile i32* null, i32** %base, align 4, !nontemporal !8
1156 ; Instructions -- Conversion Operations
1157 define void @instructions.conversions() {
1159 ; CHECK: trunc i32 -1 to i1
1161 ; CHECK: zext i32 -1 to i64
1163 ; CHECK: sext i32 -1 to i64
1164 fptrunc float undef to half
1165 ; CHECK: fptrunc float undef to half
1166 fpext half undef to float
1167 ; CHECK: fpext half undef to float
1168 fptoui float undef to i32
1169 ; CHECK: fptoui float undef to i32
1170 fptosi float undef to i32
1171 ; CHECK: fptosi float undef to i32
1172 uitofp i32 1 to float
1173 ; CHECK: uitofp i32 1 to float
1174 sitofp i32 -1 to float
1175 ; CHECK: sitofp i32 -1 to float
1176 ptrtoint i8* null to i64
1177 ; CHECK: ptrtoint i8* null to i64
1178 inttoptr i64 0 to i8*
1179 ; CHECK: inttoptr i64 0 to i8*
1180 bitcast i32 0 to i32
1181 ; CHECK: bitcast i32 0 to i32
1182 addrspacecast i32* null to i32 addrspace(1)*
1183 ; CHECK: addrspacecast i32* null to i32 addrspace(1)*
1188 ; Instructions -- Other Operations
1189 define void @instructions.other(i32 %op1, i32 %op2, half %fop1, half %fop2) {
1191 icmp eq i32 %op1, %op2
1192 ; CHECK: icmp eq i32 %op1, %op2
1193 icmp ne i32 %op1, %op2
1194 ; CHECK: icmp ne i32 %op1, %op2
1195 icmp ugt i32 %op1, %op2
1196 ; CHECK: icmp ugt i32 %op1, %op2
1197 icmp uge i32 %op1, %op2
1198 ; CHECK: icmp uge i32 %op1, %op2
1199 icmp ult i32 %op1, %op2
1200 ; CHECK: icmp ult i32 %op1, %op2
1201 icmp ule i32 %op1, %op2
1202 ; CHECK: icmp ule i32 %op1, %op2
1203 icmp sgt i32 %op1, %op2
1204 ; CHECK: icmp sgt i32 %op1, %op2
1205 icmp sge i32 %op1, %op2
1206 ; CHECK: icmp sge i32 %op1, %op2
1207 icmp slt i32 %op1, %op2
1208 ; CHECK: icmp slt i32 %op1, %op2
1209 icmp sle i32 %op1, %op2
1210 ; CHECK: icmp sle i32 %op1, %op2
1212 fcmp false half %fop1, %fop2
1213 ; CHECK: fcmp false half %fop1, %fop2
1214 fcmp oeq half %fop1, %fop2
1215 ; CHECK: fcmp oeq half %fop1, %fop2
1216 fcmp ogt half %fop1, %fop2
1217 ; CHECK: fcmp ogt half %fop1, %fop2
1218 fcmp oge half %fop1, %fop2
1219 ; CHECK: fcmp oge half %fop1, %fop2
1220 fcmp olt half %fop1, %fop2
1221 ; CHECK: fcmp olt half %fop1, %fop2
1222 fcmp ole half %fop1, %fop2
1223 ; CHECK: fcmp ole half %fop1, %fop2
1224 fcmp one half %fop1, %fop2
1225 ; CHECK: fcmp one half %fop1, %fop2
1226 fcmp ord half %fop1, %fop2
1227 ; CHECK: fcmp ord half %fop1, %fop2
1228 fcmp ueq half %fop1, %fop2
1229 ; CHECK: fcmp ueq half %fop1, %fop2
1230 fcmp ugt half %fop1, %fop2
1231 ; CHECK: fcmp ugt half %fop1, %fop2
1232 fcmp uge half %fop1, %fop2
1233 ; CHECK: fcmp uge half %fop1, %fop2
1234 fcmp ult half %fop1, %fop2
1235 ; CHECK: fcmp ult half %fop1, %fop2
1236 fcmp ule half %fop1, %fop2
1237 ; CHECK: fcmp ule half %fop1, %fop2
1238 fcmp une half %fop1, %fop2
1239 ; CHECK: fcmp une half %fop1, %fop2
1240 fcmp uno half %fop1, %fop2
1241 ; CHECK: fcmp uno half %fop1, %fop2
1242 fcmp true half %fop1, %fop2
1243 ; CHECK: fcmp true half %fop1, %fop2
1247 %v1 = add i32 %op1, %op2
1250 %v2 = add i32 %op1, %op2
1253 phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1254 ; CHECK: phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1256 select i1 true, i32 0, i32 1
1257 ; CHECK: select i1 true, i32 0, i32 1
1258 select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1259 ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1261 call void @f.nobuiltin() builtin
1262 ; CHECK: call void @f.nobuiltin() #42
1264 call void @f.strictfp() strictfp
1265 ; CHECK: call void @f.strictfp() #43
1267 call fastcc noalias i32* @f.noalias() noinline
1268 ; CHECK: call fastcc noalias i32* @f.noalias() #12
1269 tail call ghccc nonnull i32* @f.nonnull() minsize
1270 ; CHECK: tail call ghccc nonnull i32* @f.nonnull() #7
1275 define void @instructions.call_musttail(i8* inalloca %val) {
1276 musttail call void @f.param.inalloca(i8* inalloca %val)
1277 ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val)
1282 define void @instructions.call_notail() {
1283 notail call void @f1()
1284 ; CHECK: notail call void @f1()
1289 define void @instructions.landingpad() personality i32 -2 {
1290 invoke void @llvm.donothing() to label %proceed unwind label %catch1
1291 invoke void @llvm.donothing() to label %proceed unwind label %catch2
1292 invoke void @llvm.donothing() to label %proceed unwind label %catch3
1293 invoke void @llvm.donothing() to label %proceed unwind label %catch4
1297 ; CHECK: landingpad i32
1304 ; CHECK: landingpad i32
1308 ; CHECK: catch i32* null
1313 ; CHECK: landingpad i32
1317 ; CHECK: catch i32* null
1319 ; CHECK: catch i32* null
1324 ; CHECK: landingpad i32
1325 filter [2 x i32] zeroinitializer
1326 ; CHECK: filter [2 x i32] zeroinitializer
1333 ;; Intrinsic Functions
1335 ; Intrinsic Functions -- Variable Argument Handling
1336 declare void @llvm.va_start(i8*)
1337 declare void @llvm.va_copy(i8*, i8*)
1338 declare void @llvm.va_end(i8*)
1339 define void @instructions.va_arg(i8* %v, ...) {
1341 %ap2 = bitcast i8** %ap to i8*
1343 call void @llvm.va_start(i8* %ap2)
1344 ; CHECK: call void @llvm.va_start(i8* %ap2)
1346 va_arg i8* %ap2, i32
1347 ; CHECK: va_arg i8* %ap2, i32
1349 call void @llvm.va_copy(i8* %v, i8* %ap2)
1350 ; CHECK: call void @llvm.va_copy(i8* %v, i8* %ap2)
1352 call void @llvm.va_end(i8* %ap2)
1353 ; CHECK: call void @llvm.va_end(i8* %ap2)
1358 ; Intrinsic Functions -- Accurate Garbage Collection
1359 declare void @llvm.gcroot(i8**, i8*)
1360 declare i8* @llvm.gcread(i8*, i8**)
1361 declare void @llvm.gcwrite(i8*, i8*, i8**)
1362 define void @intrinsics.gc() gc "shadow-stack" {
1363 %ptrloc = alloca i8*
1364 call void @llvm.gcroot(i8** %ptrloc, i8* null)
1365 ; CHECK: call void @llvm.gcroot(i8** %ptrloc, i8* null)
1367 call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1368 ; CHECK: call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1371 call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1372 ; CHECK: call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1377 ; Intrinsic Functions -- Code Generation
1378 declare i8* @llvm.returnaddress(i32)
1379 declare i8* @llvm.frameaddress(i32)
1380 declare i32 @llvm.read_register.i32(metadata)
1381 declare i64 @llvm.read_register.i64(metadata)
1382 declare void @llvm.write_register.i32(metadata, i32)
1383 declare void @llvm.write_register.i64(metadata, i64)
1384 declare i8* @llvm.stacksave()
1385 declare void @llvm.stackrestore(i8*)
1386 declare void @llvm.prefetch(i8*, i32, i32, i32)
1387 declare void @llvm.pcmarker(i32)
1388 declare i64 @llvm.readcyclecounter()
1389 declare void @llvm.clear_cache(i8*, i8*)
1390 declare void @llvm.instrprof_increment(i8*, i64, i32, i32)
1393 define void @intrinsics.codegen() {
1394 call i8* @llvm.returnaddress(i32 1)
1395 ; CHECK: call i8* @llvm.returnaddress(i32 1)
1396 call i8* @llvm.frameaddress(i32 1)
1397 ; CHECK: call i8* @llvm.frameaddress(i32 1)
1399 call i32 @llvm.read_register.i32(metadata !10)
1400 ; CHECK: call i32 @llvm.read_register.i32(metadata !10)
1401 call i64 @llvm.read_register.i64(metadata !10)
1402 ; CHECK: call i64 @llvm.read_register.i64(metadata !10)
1403 call void @llvm.write_register.i32(metadata !10, i32 0)
1404 ; CHECK: call void @llvm.write_register.i32(metadata !10, i32 0)
1405 call void @llvm.write_register.i64(metadata !10, i64 0)
1406 ; CHECK: call void @llvm.write_register.i64(metadata !10, i64 0)
1408 %stack = call i8* @llvm.stacksave()
1409 ; CHECK: %stack = call i8* @llvm.stacksave()
1410 call void @llvm.stackrestore(i8* %stack)
1411 ; CHECK: call void @llvm.stackrestore(i8* %stack)
1413 call void @llvm.prefetch(i8* %stack, i32 0, i32 3, i32 0)
1414 ; CHECK: call void @llvm.prefetch(i8* %stack, i32 0, i32 3, i32 0)
1416 call void @llvm.pcmarker(i32 1)
1417 ; CHECK: call void @llvm.pcmarker(i32 1)
1419 call i64 @llvm.readcyclecounter()
1420 ; CHECK: call i64 @llvm.readcyclecounter()
1422 call void @llvm.clear_cache(i8* null, i8* null)
1423 ; CHECK: call void @llvm.clear_cache(i8* null, i8* null)
1425 call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1426 ; CHECK: call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1431 declare void @llvm.localescape(...)
1432 declare i8* @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
1433 define void @intrinsics.localescape() {
1434 %static.alloca = alloca i32
1435 call void (...) @llvm.localescape(i32* %static.alloca)
1436 ; CHECK: call void (...) @llvm.localescape(i32* %static.alloca)
1438 call void @intrinsics.localrecover()
1442 define void @intrinsics.localrecover() {
1443 %func = bitcast void ()* @intrinsics.localescape to i8*
1444 %fp = call i8* @llvm.frameaddress(i32 1)
1445 call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1446 ; CHECK: call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1451 ; We need this function to provide `uses' for some metadata tests.
1452 define void @misc.metadata() {
1453 call void @f1(), !srcloc !11
1454 call void @f1(), !srcloc !12
1455 call void @f1(), !srcloc !13
1456 call void @f1(), !srcloc !14
1460 declare void @op_bundle_callee_0()
1461 declare void @op_bundle_callee_1(i32,i32)
1463 define void @call_with_operand_bundle0(i32* %ptr) {
1464 ; CHECK-LABEL: call_with_operand_bundle0(
1466 %l = load i32, i32* %ptr
1468 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1469 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1473 define void @call_with_operand_bundle1(i32* %ptr) {
1474 ; CHECK-LABEL: call_with_operand_bundle1(
1476 %l = load i32, i32* %ptr
1479 call void @op_bundle_callee_0()
1480 call void @op_bundle_callee_0() [ "foo"() ]
1481 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1482 ; CHECK: @op_bundle_callee_0(){{$}}
1483 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"() ]
1484 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1488 define void @call_with_operand_bundle2(i32* %ptr) {
1489 ; CHECK-LABEL: call_with_operand_bundle2(
1491 call void @op_bundle_callee_0() [ "foo"() ]
1492 ; CHECK: call void @op_bundle_callee_0() [ "foo"() ]
1496 define void @call_with_operand_bundle3(i32* %ptr) {
1497 ; CHECK-LABEL: call_with_operand_bundle3(
1499 %l = load i32, i32* %ptr
1501 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1502 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1506 define void @call_with_operand_bundle4(i32* %ptr) {
1507 ; CHECK-LABEL: call_with_operand_bundle4(
1509 %l = load i32, i32* %ptr
1511 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) ]
1512 ; 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) ]
1516 ; Invoke versions of the above tests:
1519 define void @invoke_with_operand_bundle0(i32* %ptr) personality i8 3 {
1520 ; CHECK-LABEL: @invoke_with_operand_bundle0(
1522 %l = load i32, i32* %ptr
1524 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
1525 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1528 %cleanup = landingpad i8 cleanup
1534 define void @invoke_with_operand_bundle1(i32* %ptr) personality i8 3 {
1535 ; CHECK-LABEL: @invoke_with_operand_bundle1(
1537 %l = load i32, i32* %ptr
1540 invoke void @op_bundle_callee_0() to label %normal unwind label %exception
1541 ; CHECK: invoke void @op_bundle_callee_0(){{$}}
1544 %cleanup = landingpad i8 cleanup
1548 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal1 unwind label %exception1
1549 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1552 %cleanup1 = landingpad i8 cleanup
1556 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
1557 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1560 %cleanup2 = landingpad i8 cleanup
1567 define void @invoke_with_operand_bundle2(i32* %ptr) personality i8 3 {
1568 ; CHECK-LABEL: @invoke_with_operand_bundle2(
1570 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal unwind label %exception
1571 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1574 %cleanup = landingpad i8 cleanup
1580 define void @invoke_with_operand_bundle3(i32* %ptr) personality i8 3 {
1581 ; CHECK-LABEL: @invoke_with_operand_bundle3(
1583 %l = load i32, i32* %ptr
1585 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
1586 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1589 %cleanup = landingpad i8 cleanup
1595 define void @invoke_with_operand_bundle4(i32* %ptr) personality i8 3 {
1596 ; CHECK-LABEL: @invoke_with_operand_bundle4(
1598 %l = load i32, i32* %ptr
1600 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) ]
1601 to label %normal unwind label %exception
1602 ; 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) ]
1605 %cleanup = landingpad i8 cleanup
1611 declare void @vaargs_func(...)
1612 define void @invoke_with_operand_bundle_vaarg(i32* %ptr) personality i8 3 {
1613 ; CHECK-LABEL: @invoke_with_operand_bundle_vaarg(
1615 %l = load i32, i32* %ptr
1617 invoke void (...) @vaargs_func(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1618 to label %normal unwind label %exception
1619 ; 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) ]
1622 %cleanup = landingpad i8 cleanup
1629 declare void @f.writeonly() writeonly
1630 ; CHECK: declare void @f.writeonly() #40
1632 declare void @f.speculatable() speculatable
1633 ; CHECK: declare void @f.speculatable() #41
1635 ;; Constant Expressions
1637 define i8** @constexpr() {
1638 ; CHECK: ret i8** getelementptr inbounds ({ [4 x i8*], [4 x i8*] }, { [4 x i8*], [4 x i8*] }* null, i32 0, inrange i32 1, i32 2)
1639 ret i8** getelementptr inbounds ({ [4 x i8*], [4 x i8*] }, { [4 x i8*], [4 x i8*] }* null, i32 0, inrange i32 1, i32 2)
1642 ; CHECK: attributes #0 = { alignstack=4 }
1643 ; CHECK: attributes #1 = { alignstack=8 }
1644 ; CHECK: attributes #2 = { alwaysinline }
1645 ; CHECK: attributes #3 = { cold }
1646 ; CHECK: attributes #4 = { convergent }
1647 ; CHECK: attributes #5 = { inlinehint }
1648 ; CHECK: attributes #6 = { jumptable }
1649 ; CHECK: attributes #7 = { minsize }
1650 ; CHECK: attributes #8 = { naked }
1651 ; CHECK: attributes #9 = { nobuiltin }
1652 ; CHECK: attributes #10 = { noduplicate }
1653 ; CHECK: attributes #11 = { noimplicitfloat }
1654 ; CHECK: attributes #12 = { noinline }
1655 ; CHECK: attributes #13 = { nonlazybind }
1656 ; CHECK: attributes #14 = { noredzone }
1657 ; CHECK: attributes #15 = { noreturn }
1658 ; CHECK: attributes #16 = { nounwind }
1659 ; CHECK: attributes #17 = { noinline optnone }
1660 ; CHECK: attributes #18 = { optsize }
1661 ; CHECK: attributes #19 = { readnone }
1662 ; CHECK: attributes #20 = { readonly }
1663 ; CHECK: attributes #21 = { returns_twice }
1664 ; CHECK: attributes #22 = { safestack }
1665 ; CHECK: attributes #23 = { sanitize_address }
1666 ; CHECK: attributes #24 = { sanitize_memory }
1667 ; CHECK: attributes #25 = { sanitize_thread }
1668 ; CHECK: attributes #26 = { ssp }
1669 ; CHECK: attributes #27 = { sspreq }
1670 ; CHECK: attributes #28 = { sspstrong }
1671 ; CHECK: attributes #29 = { "thunk" }
1672 ; CHECK: attributes #30 = { uwtable }
1673 ; CHECK: attributes #31 = { "cpu"="cortex-a8" }
1674 ; CHECK: attributes #32 = { norecurse }
1675 ; CHECK: attributes #33 = { inaccessiblememonly }
1676 ; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly }
1677 ; CHECK: attributes #35 = { nounwind readnone }
1678 ; CHECK: attributes #36 = { argmemonly nounwind readonly }
1679 ; CHECK: attributes #37 = { argmemonly nounwind }
1680 ; CHECK: attributes #38 = { nounwind readonly }
1681 ; CHECK: attributes #39 = { inaccessiblemem_or_argmemonly nounwind }
1682 ; CHECK: attributes #40 = { writeonly }
1683 ; CHECK: attributes #41 = { speculatable }
1684 ; CHECK: attributes #42 = { builtin }
1685 ; CHECK: attributes #43 = { strictfp }
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}