1 ; Bitcode compatibility test for llvm
3 ; Please update this file when making any IR changes. Information on the
4 ; release process for this file is available here:
6 ; http://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility
8 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
9 ; RUN-PR24755: verify-uselistorder < %s
11 target datalayout = "E"
12 ; CHECK: target datalayout = "E"
14 target triple = "x86_64-apple-macosx10.10.0"
15 ; CHECK: target triple = "x86_64-apple-macosx10.10.0"
17 ;; Module-level assembly
18 module asm "beep boop"
19 ; CHECK: module asm "beep boop"
22 $comdat.any = comdat any
23 ; CHECK: $comdat.any = comdat any
24 $comdat.exactmatch = comdat exactmatch
25 ; CHECK: $comdat.exactmatch = comdat exactmatch
26 $comdat.largest = comdat largest
27 ; CHECK: $comdat.largest = comdat largest
28 $comdat.noduplicates = comdat noduplicates
29 ; CHECK: $comdat.noduplicates = comdat noduplicates
30 $comdat.samesize = comdat samesize
31 ; CHECK: $comdat.samesize = comdat samesize
34 @const.true = constant i1 true
35 ; CHECK: @const.true = constant i1 true
36 @const.false = constant i1 false
37 ; CHECK: @const.false = constant i1 false
38 @const.int = constant i32 zeroinitializer
39 ; CHECK: @const.int = constant i32 0
40 @const.float = constant double 0.0
41 ; CHECK: @const.float = constant double 0.0
42 @const.null = constant i8* null
43 ; CHECK: @const.null = constant i8* null
44 %const.struct.type = type { i32, i8 }
45 %const.struct.type.packed = type <{ i32, i8 }>
46 @const.struct = constant %const.struct.type { i32 -1, i8 undef }
47 ; CHECK: @const.struct = constant %const.struct.type { i32 -1, i8 undef }
48 @const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }>
49 ; CHECK: @const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }>
51 ; CHECK: @constant.array.i8 = constant [3 x i8] c"\00\01\00"
52 @constant.array.i8 = constant [3 x i8] [i8 -0, i8 1, i8 0]
53 ; CHECK: @constant.array.i16 = constant [3 x i16] [i16 0, i16 1, i16 0]
54 @constant.array.i16 = constant [3 x i16] [i16 -0, i16 1, i16 0]
55 ; CHECK: @constant.array.i32 = constant [3 x i32] [i32 0, i32 1, i32 0]
56 @constant.array.i32 = constant [3 x i32] [i32 -0, i32 1, i32 0]
57 ; CHECK: @constant.array.i64 = constant [3 x i64] [i64 0, i64 1, i64 0]
58 @constant.array.i64 = constant [3 x i64] [i64 -0, i64 1, i64 0]
59 ; CHECK: @constant.array.f16 = constant [3 x half] [half 0xH8000, half 0xH3C00, half 0xH0000]
60 @constant.array.f16 = constant [3 x half] [half -0.0, half 1.0, half 0.0]
61 ; CHECK: @constant.array.f32 = constant [3 x float] [float -0.000000e+00, float 1.000000e+00, float 0.000000e+00]
62 @constant.array.f32 = constant [3 x float] [float -0.0, float 1.0, float 0.0]
63 ; CHECK: @constant.array.f64 = constant [3 x double] [double -0.000000e+00, double 1.000000e+00, double 0.000000e+00]
64 @constant.array.f64 = constant [3 x double] [double -0.0, double 1.0, double 0.0]
66 ; CHECK: @constant.vector.i8 = constant <3 x i8> <i8 0, i8 1, i8 0>
67 @constant.vector.i8 = constant <3 x i8> <i8 -0, i8 1, i8 0>
68 ; CHECK: @constant.vector.i16 = constant <3 x i16> <i16 0, i16 1, i16 0>
69 @constant.vector.i16 = constant <3 x i16> <i16 -0, i16 1, i16 0>
70 ; CHECK: @constant.vector.i32 = constant <3 x i32> <i32 0, i32 1, i32 0>
71 @constant.vector.i32 = constant <3 x i32> <i32 -0, i32 1, i32 0>
72 ; CHECK: @constant.vector.i64 = constant <3 x i64> <i64 0, i64 1, i64 0>
73 @constant.vector.i64 = constant <3 x i64> <i64 -0, i64 1, i64 0>
74 ; CHECK: @constant.vector.f16 = constant <3 x half> <half 0xH8000, half 0xH3C00, half 0xH0000>
75 @constant.vector.f16 = constant <3 x half> <half -0.0, half 1.0, half 0.0>
76 ; CHECK: @constant.vector.f32 = constant <3 x float> <float -0.000000e+00, float 1.000000e+00, float 0.000000e+00>
77 @constant.vector.f32 = constant <3 x float> <float -0.0, float 1.0, float 0.0>
78 ; CHECK: @constant.vector.f64 = constant <3 x double> <double -0.000000e+00, double 1.000000e+00, double 0.000000e+00>
79 @constant.vector.f64 = constant <3 x double> <double -0.0, double 1.0, double 0.0>
82 ; Format: [@<GlobalVarName> =] [Linkage] [Visibility] [DLLStorageClass]
83 ; [ThreadLocal] [(unnamed_addr|local_unnamed_addr)] [AddrSpace] [ExternallyInitialized]
84 ; <global | constant> <Type> [<InitializerConstant>]
85 ; [, section "name"] [, comdat [($name)]] [, align <Alignment>]
87 ; Global Variables -- Simple
89 ; CHECK: @g1 = global i32 0
91 ; CHECK: @g2 = constant i32 0
93 ; Global Variables -- Linkage
94 @g.private = private global i32 0
95 ; CHECK: @g.private = private global i32 0
96 @g.internal = internal global i32 0
97 ; CHECK: @g.internal = internal global i32 0
98 @g.available_externally = available_externally global i32 0
99 ; CHECK: @g.available_externally = available_externally global i32 0
100 @g.linkonce = linkonce global i32 0
101 ; CHECK: @g.linkonce = linkonce global i32 0
102 @g.weak = weak global i32 0
103 ; CHECK: @g.weak = weak global i32 0
104 @g.common = common global i32 0
105 ; CHECK: @g.common = common global i32 0
106 @g.appending = appending global [4 x i8] c"test"
107 ; CHECK: @g.appending = appending global [4 x i8] c"test"
108 @g.extern_weak = extern_weak global i32
109 ; CHECK: @g.extern_weak = extern_weak global i32
110 @g.linkonce_odr = linkonce_odr global i32 0
111 ; CHECK: @g.linkonce_odr = linkonce_odr global i32 0
112 @g.weak_odr = weak_odr global i32 0
113 ; CHECK: @g.weak_odr = weak_odr global i32 0
114 @g.external = external global i32
115 ; CHECK: @g.external = external global i32
117 ; Global Variables -- Visibility
118 @g.default = default global i32 0
119 ; CHECK: @g.default = global i32 0
120 @g.hidden = hidden global i32 0
121 ; CHECK: @g.hidden = hidden global i32 0
122 @g.protected = protected global i32 0
123 ; CHECK: @g.protected = protected global i32 0
125 ; Global Variables -- DLLStorageClass
126 @g.dlldefault = default global i32 0
127 ; CHECK: @g.dlldefault = global i32 0
128 @g.dllimport = external dllimport global i32
129 ; CHECK: @g.dllimport = external dllimport global i32
130 @g.dllexport = dllexport global i32 0
131 ; CHECK: @g.dllexport = dllexport global i32 0
133 ; Global Variables -- ThreadLocal
134 @g.notthreadlocal = global i32 0
135 ; CHECK: @g.notthreadlocal = global i32 0
136 @g.generaldynamic = thread_local global i32 0
137 ; CHECK: @g.generaldynamic = thread_local global i32 0
138 @g.localdynamic = thread_local(localdynamic) global i32 0
139 ; CHECK: @g.localdynamic = thread_local(localdynamic) global i32 0
140 @g.initialexec = thread_local(initialexec) global i32 0
141 ; CHECK: @g.initialexec = thread_local(initialexec) global i32 0
142 @g.localexec = thread_local(localexec) global i32 0
143 ; CHECK: @g.localexec = thread_local(localexec) global i32 0
145 ; Global Variables -- unnamed_addr and local_unnamed_addr
146 @g.unnamed_addr = unnamed_addr global i32 0
147 ; CHECK: @g.unnamed_addr = unnamed_addr global i32 0
148 @g.local_unnamed_addr = local_unnamed_addr global i32 0
149 ; CHECK: @g.local_unnamed_addr = local_unnamed_addr global i32 0
151 ; Global Variables -- AddrSpace
152 @g.addrspace = addrspace(1) global i32 0
153 ; CHECK: @g.addrspace = addrspace(1) global i32 0
155 ; Global Variables -- ExternallyInitialized
156 @g.externally_initialized = external externally_initialized global i32
157 ; CHECK: @g.externally_initialized = external externally_initialized global i32
159 ; Global Variables -- section
160 @g.section = global i32 0, section "_DATA"
161 ; CHECK: @g.section = global i32 0, section "_DATA"
163 ; Global Variables -- comdat
164 @comdat.any = global i32 0, comdat
165 ; CHECK: @comdat.any = global i32 0, comdat
166 @comdat.exactmatch = global i32 0, comdat
167 ; CHECK: @comdat.exactmatch = global i32 0, comdat
168 @comdat.largest = global i32 0, comdat
169 ; CHECK: @comdat.largest = global i32 0, comdat
170 @comdat.noduplicates = global i32 0, comdat
171 ; CHECK: @comdat.noduplicates = global i32 0, comdat
172 @comdat.samesize = global i32 0, comdat
173 ; CHECK: @comdat.samesize = global i32 0, comdat
175 ; Force two globals from different comdats into sections with the same name.
176 $comdat1 = comdat any
177 $comdat2 = comdat any
178 @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
179 ; CHECK: @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
180 @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
181 ; CHECK: @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
183 ; Global Variables -- align
184 @g.align = global i32 0, align 4
185 ; CHECK: @g.align = global i32 0, align 4
187 ; Global Variables -- Intrinsics
188 %pri.func.data = type { i32, void ()*, i8* }
189 @g.used1 = global i32 0
190 @g.used2 = global i32 0
191 @g.used3 = global i8 0
193 @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
194 ; CHECK: @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
195 @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
196 ; CHECK: @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
197 @llvm.global_ctors = 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_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
199 @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
200 ; 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"
203 ; Format: @<Name> = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
204 ; [unnamed_addr] alias <AliaseeTy> @<Aliasee>
207 @a.private = private alias i32, i32* @g.private
208 ; CHECK: @a.private = private alias i32, i32* @g.private
209 @a.internal = internal alias i32, i32* @g.internal
210 ; CHECK: @a.internal = internal alias i32, i32* @g.internal
211 @a.linkonce = linkonce alias i32, i32* @g.linkonce
212 ; CHECK: @a.linkonce = linkonce alias i32, i32* @g.linkonce
213 @a.weak = weak alias i32, i32* @g.weak
214 ; CHECK: @a.weak = weak alias i32, i32* @g.weak
215 @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
216 ; CHECK: @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
217 @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
218 ; CHECK: @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
219 @a.external = external alias i32, i32* @g1
220 ; CHECK: @a.external = alias i32, i32* @g1
222 ; Aliases -- Visibility
223 @a.default = default alias i32, i32* @g.default
224 ; CHECK: @a.default = alias i32, i32* @g.default
225 @a.hidden = hidden alias i32, i32* @g.hidden
226 ; CHECK: @a.hidden = hidden alias i32, i32* @g.hidden
227 @a.protected = protected alias i32, i32* @g.protected
228 ; CHECK: @a.protected = protected alias i32, i32* @g.protected
230 ; Aliases -- DLLStorageClass
231 @a.dlldefault = default alias i32, i32* @g.dlldefault
232 ; CHECK: @a.dlldefault = alias i32, i32* @g.dlldefault
233 @a.dllexport = dllexport alias i32, i32* @g.dllexport
234 ; CHECK: @a.dllexport = dllexport alias i32, i32* @g.dllexport
236 ; Aliases -- ThreadLocal
237 @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
238 ; CHECK: @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
239 @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
240 ; CHECK: @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
241 @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
242 ; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
243 @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
244 ; CHECK: @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
245 @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
246 ; CHECK: @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
248 ; Aliases -- unnamed_addr and local_unnamed_addr
249 @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
250 ; CHECK: @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
251 @a.local_unnamed_addr = local_unnamed_addr alias i32, i32* @g.local_unnamed_addr
252 ; CHECK: @a.local_unnamed_addr = local_unnamed_addr alias i32, i32* @g.local_unnamed_addr
255 ; Format @<Name> = [Linkage] [Visibility] ifunc <IFuncTy>,
256 ; <ResolverTy>* @<Resolver>
259 @ifunc.external = external ifunc void (), i8* ()* @ifunc_resolver
260 ; CHECK: @ifunc.external = ifunc void (), i8* ()* @ifunc_resolver
261 @ifunc.private = private ifunc void (), i8* ()* @ifunc_resolver
262 ; CHECK: @ifunc.private = private ifunc void (), i8* ()* @ifunc_resolver
263 @ifunc.internal = internal ifunc void (), i8* ()* @ifunc_resolver
264 ; CHECK: @ifunc.internal = internal ifunc void (), i8* ()* @ifunc_resolver
266 ; IFunc -- Visibility
267 @ifunc.default = default ifunc void (), i8* ()* @ifunc_resolver
268 ; CHECK: @ifunc.default = ifunc void (), i8* ()* @ifunc_resolver
269 @ifunc.hidden = hidden ifunc void (), i8* ()* @ifunc_resolver
270 ; CHECK: @ifunc.hidden = hidden ifunc void (), i8* ()* @ifunc_resolver
271 @ifunc.protected = protected ifunc void (), i8* ()* @ifunc_resolver
272 ; CHECK: @ifunc.protected = protected ifunc void (), i8* ()* @ifunc_resolver
274 define i8* @ifunc_resolver() {
280 ; Format: define [linkage] [visibility] [DLLStorageClass]
281 ; [cconv] [ret attrs]
282 ; <ResultType> @<FunctionName> ([argument list])
283 ; [(unnamed_addr|local_unnamed_addr)] [fn Attrs] [section "name"] [comdat [($name)]]
284 ; [align N] [gc] [prefix Constant] [prologue Constant]
285 ; [personality Constant] { ... }
287 ; Functions -- Simple
289 ; CHECK: declare void @f1()
292 ; CHECK: define void @f2()
297 ; Functions -- linkage
298 define private void @f.private() {
299 ; CHECK: define private void @f.private()
303 define internal void @f.internal() {
304 ; CHECK: define internal void @f.internal()
308 define available_externally void @f.available_externally() {
309 ; CHECK: define available_externally void @f.available_externally()
313 define linkonce void @f.linkonce() {
314 ; CHECK: define linkonce void @f.linkonce()
318 define weak void @f.weak() {
319 ; CHECK: define weak void @f.weak()
323 define linkonce_odr void @f.linkonce_odr() {
324 ; CHECK: define linkonce_odr void @f.linkonce_odr()
328 define weak_odr void @f.weak_odr() {
329 ; CHECK: define weak_odr void @f.weak_odr()
333 declare external void @f.external()
334 ; CHECK: declare void @f.external()
335 declare extern_weak void @f.extern_weak()
336 ; CHECK: declare extern_weak void @f.extern_weak()
338 ; Functions -- visibility
339 declare default void @f.default()
340 ; CHECK: declare void @f.default()
341 declare hidden void @f.hidden()
342 ; CHECK: declare hidden void @f.hidden()
343 declare protected void @f.protected()
344 ; CHECK: declare protected void @f.protected()
346 ; Functions -- DLLStorageClass
347 declare dllimport void @f.dllimport()
348 ; CHECK: declare dllimport void @f.dllimport()
349 declare dllexport void @f.dllexport()
350 ; CHECK: declare dllexport void @f.dllexport()
352 ; Functions -- cconv (Calling conventions)
353 declare ccc void @f.ccc()
354 ; CHECK: declare void @f.ccc()
355 declare fastcc void @f.fastcc()
356 ; CHECK: declare fastcc void @f.fastcc()
357 declare coldcc void @f.coldcc()
358 ; CHECK: declare coldcc void @f.coldcc()
359 declare cc10 void @f.cc10()
360 ; CHECK: declare ghccc void @f.cc10()
361 declare ghccc void @f.ghccc()
362 ; CHECK: declare ghccc void @f.ghccc()
363 declare cc11 void @f.cc11()
364 ; CHECK: declare cc11 void @f.cc11()
365 declare webkit_jscc void @f.webkit_jscc()
366 ; CHECK: declare webkit_jscc void @f.webkit_jscc()
367 declare anyregcc void @f.anyregcc()
368 ; CHECK: declare anyregcc void @f.anyregcc()
369 declare preserve_mostcc void @f.preserve_mostcc()
370 ; CHECK: declare preserve_mostcc void @f.preserve_mostcc()
371 declare preserve_allcc void @f.preserve_allcc()
372 ; CHECK: declare preserve_allcc void @f.preserve_allcc()
373 declare cc64 void @f.cc64()
374 ; CHECK: declare x86_stdcallcc void @f.cc64()
375 declare x86_stdcallcc void @f.x86_stdcallcc()
376 ; CHECK: declare x86_stdcallcc void @f.x86_stdcallcc()
377 declare cc65 void @f.cc65()
378 ; CHECK: declare x86_fastcallcc void @f.cc65()
379 declare x86_fastcallcc void @f.x86_fastcallcc()
380 ; CHECK: declare x86_fastcallcc void @f.x86_fastcallcc()
381 declare cc66 void @f.cc66()
382 ; CHECK: declare arm_apcscc void @f.cc66()
383 declare arm_apcscc void @f.arm_apcscc()
384 ; CHECK: declare arm_apcscc void @f.arm_apcscc()
385 declare cc67 void @f.cc67()
386 ; CHECK: declare arm_aapcscc void @f.cc67()
387 declare arm_aapcscc void @f.arm_aapcscc()
388 ; CHECK: declare arm_aapcscc void @f.arm_aapcscc()
389 declare cc68 void @f.cc68()
390 ; CHECK: declare arm_aapcs_vfpcc void @f.cc68()
391 declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
392 ; CHECK: declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
393 declare cc69 void @f.cc69()
394 ; CHECK: declare msp430_intrcc void @f.cc69()
395 declare msp430_intrcc void @f.msp430_intrcc()
396 ; CHECK: declare msp430_intrcc void @f.msp430_intrcc()
397 declare cc70 void @f.cc70()
398 ; CHECK: declare x86_thiscallcc void @f.cc70()
399 declare x86_thiscallcc void @f.x86_thiscallcc()
400 ; CHECK: declare x86_thiscallcc void @f.x86_thiscallcc()
401 declare cc71 void @f.cc71()
402 ; CHECK: declare ptx_kernel void @f.cc71()
403 declare ptx_kernel void @f.ptx_kernel()
404 ; CHECK: declare ptx_kernel void @f.ptx_kernel()
405 declare cc72 void @f.cc72()
406 ; CHECK: declare ptx_device void @f.cc72()
407 declare ptx_device void @f.ptx_device()
408 ; CHECK: declare ptx_device void @f.ptx_device()
409 declare cc75 void @f.cc75()
410 ; CHECK: declare spir_func void @f.cc75()
411 declare spir_func void @f.spir_func()
412 ; CHECK: declare spir_func void @f.spir_func()
413 declare cc76 void @f.cc76()
414 ; CHECK: declare spir_kernel void @f.cc76()
415 declare spir_kernel void @f.spir_kernel()
416 ; CHECK: declare spir_kernel void @f.spir_kernel()
417 declare cc77 void @f.cc77()
418 ; CHECK: declare intel_ocl_bicc void @f.cc77()
419 declare intel_ocl_bicc void @f.intel_ocl_bicc()
420 ; CHECK: declare intel_ocl_bicc void @f.intel_ocl_bicc()
421 declare cc78 void @f.cc78()
422 ; CHECK: declare x86_64_sysvcc void @f.cc78()
423 declare x86_64_sysvcc void @f.x86_64_sysvcc()
424 ; CHECK: declare x86_64_sysvcc void @f.x86_64_sysvcc()
425 declare cc79 void @f.cc79()
426 ; CHECK: declare win64cc void @f.cc79()
427 declare win64cc void @f.win64cc()
428 ; CHECK: declare win64cc void @f.win64cc()
429 declare cc80 void @f.cc80()
430 ; CHECK: declare x86_vectorcallcc void @f.cc80()
431 declare x86_vectorcallcc void @f.x86_vectorcallcc()
432 ; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc()
433 declare cc81 void @f.cc81()
434 ; CHECK: declare hhvmcc void @f.cc81()
435 declare hhvmcc void @f.hhvmcc()
436 ; CHECK: declare hhvmcc void @f.hhvmcc()
437 declare cc82 void @f.cc82()
438 ; CHECK: declare hhvm_ccc void @f.cc82()
439 declare hhvm_ccc void @f.hhvm_ccc()
440 ; CHECK: declare hhvm_ccc void @f.hhvm_ccc()
441 declare cc83 void @f.cc83()
442 ; CHECK: declare x86_intrcc void @f.cc83()
443 declare x86_intrcc void @f.x86_intrcc()
444 ; CHECK: declare x86_intrcc void @f.x86_intrcc()
445 declare cc84 void @f.cc84()
446 ; CHECK: declare avr_intrcc void @f.cc84()
447 declare avr_intrcc void @f.avr_intrcc()
448 ; CHECK: declare avr_intrcc void @f.avr_intrcc()
449 declare cc85 void @f.cc85()
450 ; CHECK: declare avr_signalcc void @f.cc85()
451 declare avr_signalcc void @f.avr_signalcc()
452 ; CHECK: declare avr_signalcc void @f.avr_signalcc()
453 declare cc87 void @f.cc87()
454 ; CHECK: declare amdgpu_vs void @f.cc87()
455 declare amdgpu_vs void @f.amdgpu_vs()
456 ; CHECK: declare amdgpu_vs void @f.amdgpu_vs()
457 declare cc88 void @f.cc88()
458 ; CHECK: declare amdgpu_gs void @f.cc88()
459 declare amdgpu_gs void @f.amdgpu_gs()
460 ; CHECK: declare amdgpu_gs void @f.amdgpu_gs()
461 declare cc89 void @f.cc89()
462 ; CHECK: declare amdgpu_ps void @f.cc89()
463 declare amdgpu_ps void @f.amdgpu_ps()
464 ; CHECK: declare amdgpu_ps void @f.amdgpu_ps()
465 declare cc90 void @f.cc90()
466 ; CHECK: declare amdgpu_cs void @f.cc90()
467 declare amdgpu_cs void @f.amdgpu_cs()
468 ; CHECK: declare amdgpu_cs void @f.amdgpu_cs()
469 declare cc91 void @f.cc91()
470 ; CHECK: declare amdgpu_kernel void @f.cc91()
471 declare amdgpu_kernel void @f.amdgpu_kernel()
472 ; CHECK: declare amdgpu_kernel void @f.amdgpu_kernel()
473 declare cc93 void @f.cc93()
474 ; CHECK: declare amdgpu_hs void @f.cc93()
475 declare amdgpu_hs void @f.amdgpu_hs()
476 ; CHECK: declare amdgpu_hs void @f.amdgpu_hs()
477 declare cc95 void @f.cc95()
478 ; CHECK: declare amdgpu_ls void @f.cc95()
479 declare amdgpu_ls void @f.amdgpu_ls()
480 ; CHECK: declare amdgpu_ls void @f.amdgpu_ls()
481 declare cc96 void @f.cc96()
482 ; CHECK: declare amdgpu_es void @f.cc96()
483 declare amdgpu_es void @f.amdgpu_es()
484 ; CHECK: declare amdgpu_es void @f.amdgpu_es()
485 declare cc1023 void @f.cc1023()
486 ; CHECK: declare cc1023 void @f.cc1023()
488 ; Functions -- ret attrs (Return attributes)
489 declare zeroext i64 @f.zeroext()
490 ; CHECK: declare zeroext i64 @f.zeroext()
491 declare signext i64 @f.signext()
492 ; CHECK: declare signext i64 @f.signext()
493 declare inreg i32* @f.inreg()
494 ; CHECK: declare inreg i32* @f.inreg()
495 declare noalias i32* @f.noalias()
496 ; CHECK: declare noalias i32* @f.noalias()
497 declare nonnull i32* @f.nonnull()
498 ; CHECK: declare nonnull i32* @f.nonnull()
499 declare dereferenceable(4) i32* @f.dereferenceable4()
500 ; CHECK: declare dereferenceable(4) i32* @f.dereferenceable4()
501 declare dereferenceable(8) i32* @f.dereferenceable8()
502 ; CHECK: declare dereferenceable(8) i32* @f.dereferenceable8()
503 declare dereferenceable(16) i32* @f.dereferenceable16()
504 ; CHECK: declare dereferenceable(16) i32* @f.dereferenceable16()
505 declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
506 ; CHECK: declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
507 declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
508 ; CHECK: declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
509 declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
510 ; CHECK: declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
512 ; Functions -- Parameter attributes
513 declare void @f.param.zeroext(i8 zeroext)
514 ; CHECK: declare void @f.param.zeroext(i8 zeroext)
515 declare void @f.param.signext(i8 signext)
516 ; CHECK: declare void @f.param.signext(i8 signext)
517 declare void @f.param.inreg(i8 inreg)
518 ; CHECK: declare void @f.param.inreg(i8 inreg)
519 declare void @f.param.byval({ i8, i8 }* byval)
520 ; CHECK: declare void @f.param.byval({ i8, i8 }* byval)
521 declare void @f.param.inalloca(i8* inalloca)
522 ; CHECK: declare void @f.param.inalloca(i8* inalloca)
523 declare void @f.param.sret(i8* sret)
524 ; CHECK: declare void @f.param.sret(i8* sret)
525 declare void @f.param.noalias(i8* noalias)
526 ; CHECK: declare void @f.param.noalias(i8* noalias)
527 declare void @f.param.nocapture(i8* nocapture)
528 ; CHECK: declare void @f.param.nocapture(i8* nocapture)
529 declare void @f.param.nest(i8* nest)
530 ; CHECK: declare void @f.param.nest(i8* nest)
531 declare i8* @f.param.returned(i8* returned)
532 ; CHECK: declare i8* @f.param.returned(i8* returned)
533 declare void @f.param.nonnull(i8* nonnull)
534 ; CHECK: declare void @f.param.nonnull(i8* nonnull)
535 declare void @f.param.dereferenceable(i8* dereferenceable(4))
536 ; CHECK: declare void @f.param.dereferenceable(i8* dereferenceable(4))
537 declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
538 ; CHECK: declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
540 ; Functions -- unnamed_addr and local_unnamed_addr
541 declare void @f.unnamed_addr() unnamed_addr
542 ; CHECK: declare void @f.unnamed_addr() unnamed_addr
543 declare void @f.local_unnamed_addr() local_unnamed_addr
544 ; CHECK: declare void @f.local_unnamed_addr() local_unnamed_addr
546 ; Functions -- fn Attrs (Function attributes)
547 declare void @f.alignstack4() alignstack(4)
548 ; CHECK: declare void @f.alignstack4() #0
549 declare void @f.alignstack8() alignstack(8)
550 ; CHECK: declare void @f.alignstack8() #1
551 declare void @f.alwaysinline() alwaysinline
552 ; CHECK: declare void @f.alwaysinline() #2
553 declare void @f.cold() cold
554 ; CHECK: declare void @f.cold() #3
555 declare void @f.convergent() convergent
556 ; CHECK: declare void @f.convergent() #4
557 declare void @f.inlinehint() inlinehint
558 ; CHECK: declare void @f.inlinehint() #5
559 declare void @f.jumptable() unnamed_addr jumptable
560 ; CHECK: declare void @f.jumptable() unnamed_addr #6
561 declare void @f.minsize() minsize
562 ; CHECK: declare void @f.minsize() #7
563 declare void @f.naked() naked
564 ; CHECK: declare void @f.naked() #8
565 declare void @f.nobuiltin() nobuiltin
566 ; CHECK: declare void @f.nobuiltin() #9
567 declare void @f.noduplicate() noduplicate
568 ; CHECK: declare void @f.noduplicate() #10
569 declare void @f.noimplicitfloat() noimplicitfloat
570 ; CHECK: declare void @f.noimplicitfloat() #11
571 declare void @f.noinline() noinline
572 ; CHECK: declare void @f.noinline() #12
573 declare void @f.nonlazybind() nonlazybind
574 ; CHECK: declare void @f.nonlazybind() #13
575 declare void @f.noredzone() noredzone
576 ; CHECK: declare void @f.noredzone() #14
577 declare void @f.noreturn() noreturn
578 ; CHECK: declare void @f.noreturn() #15
579 declare void @f.nounwind() nounwind
580 ; CHECK: declare void @f.nounwind() #16
581 declare void @f.optnone() noinline optnone
582 ; CHECK: declare void @f.optnone() #17
583 declare void @f.optsize() optsize
584 ; CHECK: declare void @f.optsize() #18
585 declare void @f.readnone() readnone
586 ; CHECK: declare void @f.readnone() #19
587 declare void @f.readonly() readonly
588 ; CHECK: declare void @f.readonly() #20
589 declare void @f.returns_twice() returns_twice
590 ; CHECK: declare void @f.returns_twice() #21
591 declare void @f.safestack() safestack
592 ; CHECK: declare void @f.safestack() #22
593 declare void @f.sanitize_address() sanitize_address
594 ; CHECK: declare void @f.sanitize_address() #23
595 declare void @f.sanitize_memory() sanitize_memory
596 ; CHECK: declare void @f.sanitize_memory() #24
597 declare void @f.sanitize_thread() sanitize_thread
598 ; CHECK: declare void @f.sanitize_thread() #25
599 declare void @f.ssp() ssp
600 ; CHECK: declare void @f.ssp() #26
601 declare void @f.sspreq() sspreq
602 ; CHECK: declare void @f.sspreq() #27
603 declare void @f.sspstrong() sspstrong
604 ; CHECK: declare void @f.sspstrong() #28
605 declare void @f.thunk() "thunk"
606 ; CHECK: declare void @f.thunk() #29
607 declare void @f.uwtable() uwtable
608 ; CHECK: declare void @f.uwtable() #30
609 declare void @f.kvpair() "cpu"="cortex-a8"
610 ; CHECK:declare void @f.kvpair() #31
611 declare void @f.norecurse() norecurse
612 ; CHECK: declare void @f.norecurse() #32
613 declare void @f.inaccessiblememonly() inaccessiblememonly
614 ; CHECK: declare void @f.inaccessiblememonly() #33
615 declare void @f.inaccessiblemem_or_argmemonly() inaccessiblemem_or_argmemonly
616 ; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #34
617 declare void @f.strictfp() #35
619 ; Functions -- section
620 declare void @f.section() section "80"
621 ; CHECK: declare void @f.section() section "80"
623 ; Functions -- comdat
624 define void @f.comdat_any() comdat($comdat.any) {
625 ; CHECK: define void @f.comdat_any() comdat($comdat.any)
629 define void @f.comdat_exactmatch() comdat($comdat.exactmatch) {
630 ; CHECK: define void @f.comdat_exactmatch() comdat($comdat.exactmatch)
634 define void @f.comdat_largest() comdat($comdat.largest) {
635 ; CHECK: define void @f.comdat_largest() comdat($comdat.largest)
639 define void @f.comdat_noduplicates() comdat($comdat.noduplicates) {
640 ; CHECK: define void @f.comdat_noduplicates() comdat($comdat.noduplicates)
644 define void @f.comdat_samesize() comdat($comdat.samesize) {
645 ; CHECK: define void @f.comdat_samesize() comdat($comdat.samesize)
651 declare void @f.align2() align 2
652 ; CHECK: declare void @f.align2() align 2
653 declare void @f.align4() align 4
654 ; CHECK: declare void @f.align4() align 4
655 declare void @f.align8() align 8
656 ; CHECK: declare void @f.align8() align 8
659 declare void @f.gcshadow() gc "shadow-stack"
660 ; CHECK: declare void @f.gcshadow() gc "shadow-stack"
662 ; Functions -- Prefix data
663 declare void @f.prefixi32() prefix i32 1684365668
664 ; CHECK: declare void @f.prefixi32() prefix i32 1684365668
665 declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
666 ; CHECK: declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
668 ; Functions -- Prologue data
669 declare void @f.prologuei32() prologue i32 1684365669
670 ; CHECK: declare void @f.prologuei32() prologue i32 1684365669
671 declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
672 ; CHECK: declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
674 ; Functions -- Personality constant
675 declare void @llvm.donothing() nounwind readnone
676 ; CHECK: declare void @llvm.donothing() #35
677 define void @f.no_personality() personality i8 3 {
678 ; CHECK: define void @f.no_personality() personality i8 3
679 invoke void @llvm.donothing() to label %normal unwind label %exception
681 %cleanup = landingpad i8 cleanup
687 declare i32 @f.personality_handler()
688 ; CHECK: declare i32 @f.personality_handler()
689 define void @f.personality() personality i32 ()* @f.personality_handler {
690 ; CHECK: define void @f.personality() personality i32 ()* @f.personality_handler
691 invoke void @llvm.donothing() to label %normal unwind label %exception
693 %cleanup = landingpad i32 cleanup
699 ;; Atomic Memory Ordering Constraints
700 define void @atomics(i32* %word) {
701 %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
702 ; CHECK: %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
703 %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
704 ; CHECK: %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
705 %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
706 ; CHECK: %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
707 %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
708 ; CHECK: %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
709 %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
710 ; CHECK: %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
711 %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
712 ; CHECK: %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
713 %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
714 ; CHECK: %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
715 %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
716 ; CHECK: %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
717 %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
718 ; CHECK: %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
719 %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic
720 ; CHECK: %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic
721 %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic
722 ; CHECK: %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic
723 %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic
724 ; CHECK: %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic
725 %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic
726 ; CHECK: %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic
727 %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic
728 ; CHECK: %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic
729 %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic
730 ; CHECK: %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic
731 %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic
732 ; CHECK: %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic
733 %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic
734 ; CHECK: %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic
735 %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic
736 ; CHECK: %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic
737 %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic
738 ; CHECK: %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic
740 ; CHECK: fence acquire
742 ; CHECK: fence release
744 ; CHECK: fence acq_rel
745 fence syncscope("singlethread") seq_cst
746 ; CHECK: fence syncscope("singlethread") seq_cst
748 %ld.1 = load atomic i32, i32* %word monotonic, align 4
749 ; CHECK: %ld.1 = load atomic i32, i32* %word monotonic, align 4
750 %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
751 ; CHECK: %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
752 %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16
753 ; CHECK: %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16
755 store atomic i32 23, i32* %word monotonic, align 4
756 ; CHECK: store atomic i32 23, i32* %word monotonic, align 4
757 store atomic volatile i32 24, i32* %word monotonic, align 4
758 ; CHECK: store atomic volatile i32 24, i32* %word monotonic, align 4
759 store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4
760 ; CHECK: store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4
764 define void @fp_atomics(float* %word) {
765 ; CHECK: %atomicrmw.xchg = atomicrmw xchg float* %word, float 1.000000e+00 monotonic
766 %atomicrmw.xchg = atomicrmw xchg float* %word, float 1.0 monotonic
768 ; CHECK: %atomicrmw.fadd = atomicrmw fadd float* %word, float 1.000000e+00 monotonic
769 %atomicrmw.fadd = atomicrmw fadd float* %word, float 1.0 monotonic
771 ; CHECK: %atomicrmw.fsub = atomicrmw fsub float* %word, float 1.000000e+00 monotonic
772 %atomicrmw.fsub = atomicrmw fsub float* %word, float 1.0 monotonic
778 define void @fastmathflags_unop(float %op1) {
779 %f.nnan = fneg nnan float %op1
780 ; CHECK: %f.nnan = fneg nnan float %op1
781 %f.ninf = fneg ninf float %op1
782 ; CHECK: %f.ninf = fneg ninf float %op1
783 %f.nsz = fneg nsz float %op1
784 ; CHECK: %f.nsz = fneg nsz float %op1
785 %f.arcp = fneg arcp float %op1
786 ; CHECK: %f.arcp = fneg arcp float %op1
787 %f.contract = fneg contract float %op1
788 ; CHECK: %f.contract = fneg contract float %op1
789 %f.afn = fneg afn float %op1
790 ; CHECK: %f.afn = fneg afn float %op1
791 %f.reassoc = fneg reassoc float %op1
792 ; CHECK: %f.reassoc = fneg reassoc float %op1
793 %f.fast = fneg fast float %op1
794 ; CHECK: %f.fast = fneg fast float %op1
798 define void @fastmathflags_binops(float %op1, float %op2) {
799 %f.nnan = fadd nnan float %op1, %op2
800 ; CHECK: %f.nnan = fadd nnan float %op1, %op2
801 %f.ninf = fadd ninf float %op1, %op2
802 ; CHECK: %f.ninf = fadd ninf float %op1, %op2
803 %f.nsz = fadd nsz float %op1, %op2
804 ; CHECK: %f.nsz = fadd nsz float %op1, %op2
805 %f.arcp = fadd arcp float %op1, %op2
806 ; CHECK: %f.arcp = fadd arcp float %op1, %op2
807 %f.contract = fadd contract float %op1, %op2
808 ; CHECK: %f.contract = fadd contract float %op1, %op2
809 %f.afn = fadd afn float %op1, %op2
810 ; CHECK: %f.afn = fadd afn float %op1, %op2
811 %f.reassoc = fadd reassoc float %op1, %op2
812 ; CHECK: %f.reassoc = fadd reassoc float %op1, %op2
813 %f.fast = fadd fast float %op1, %op2
814 ; CHECK: %f.fast = fadd fast float %op1, %op2
818 ; Check various fast math flags and floating-point types on calls.
820 declare float @fmf1()
821 declare double @fmf2()
822 declare <4 x double> @fmf3()
824 ; CHECK-LABEL: fastMathFlagsForCalls(
825 define void @fastMathFlagsForCalls(float %f, double %d1, <4 x double> %d2) {
826 %call.fast = call fast float @fmf1()
827 ; CHECK: %call.fast = call fast float @fmf1()
829 ; Throw in some other attributes to make sure those stay in the right places.
831 %call.nsz.arcp = notail call nsz arcp double @fmf2()
832 ; CHECK: %call.nsz.arcp = notail call nsz arcp double @fmf2()
834 %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
835 ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
841 %opaquety = type opaque
842 define void @typesystem() {
843 %p0 = bitcast i8* null to i32 (i32)*
844 ; CHECK: %p0 = bitcast i8* null to i32 (i32)*
845 %p1 = bitcast i8* null to void (i8*)*
846 ; CHECK: %p1 = bitcast i8* null to void (i8*)*
847 %p2 = bitcast i8* null to i32 (i8*, ...)*
848 ; CHECK: %p2 = bitcast i8* null to i32 (i8*, ...)*
849 %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
850 ; CHECK: %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
851 %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
852 ; CHECK: %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
853 %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
854 ; CHECK: %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
856 %t0 = alloca i1942652
857 ; CHECK: %t0 = alloca i1942652
859 ; CHECK: %t1 = alloca half
861 ; CHECK: %t2 = alloca float
863 ; CHECK: %t3 = alloca double
865 ; CHECK: %t4 = alloca fp128
866 %t5 = alloca x86_fp80
867 ; CHECK: %t5 = alloca x86_fp80
868 %t6 = alloca ppc_fp128
869 ; CHECK: %t6 = alloca ppc_fp128
871 ; CHECK: %t7 = alloca x86_mmx
872 %t8 = alloca %opaquety*
873 ; CHECK: %t8 = alloca %opaquety*
878 declare void @llvm.token(token)
879 ; CHECK: declare void @llvm.token(token)
881 ;; Inline Assembler Expressions
882 define void @inlineasm(i32 %arg) {
883 call i32 asm "bswap $0", "=r,r"(i32 %arg)
884 ; CHECK: call i32 asm "bswap $0", "=r,r"(i32 %arg)
885 call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
886 ; CHECK: call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
892 ; Instructions -- Terminators
893 define void @instructions.terminators(i8 %val) personality i32 -10 {
894 br i1 false, label %iftrue, label %iffalse
895 ; CHECK: br i1 false, label %iftrue, label %iffalse
897 ; CHECK: br label %iftrue
903 switch i8 %val, label %defaultdest [
904 ; CHECK: switch i8 %val, label %defaultdest [
905 i8 0, label %defaultdest.0
906 ; CHECK: i8 0, label %defaultdest.0
907 i8 1, label %defaultdest.1
908 ; CHECK: i8 1, label %defaultdest.1
909 i8 2, label %defaultdest.2
910 ; CHECK: i8 2, label %defaultdest.2
921 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
922 ; CHECK: indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
923 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
924 ; CHECK: indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
926 invoke fastcc void @f.fastcc()
927 ; CHECK: invoke fastcc void @f.fastcc()
928 to label %defaultdest unwind label %exc
929 ; CHECK: to label %defaultdest unwind label %exc
931 %cleanup = landingpad i32 cleanup
934 ; CHECK: resume i32 undef
941 define i32 @instructions.win_eh.1() personality i32 -3 {
945 invoke void @f.ccc() to label %normal unwind label %catchswitch1
946 invoke void @f.ccc() to label %normal unwind label %catchswitch2
947 invoke void @f.ccc() to label %normal unwind label %catchswitch3
950 %cs1 = catchswitch within none [label %catchpad1] unwind to caller
953 catchpad within %cs1 []
955 ; CHECK: catchpad within %cs1 []
956 ; CHECK-NEXT: br label %normal
959 %cs2 = catchswitch within none [label %catchpad2] unwind to caller
962 catchpad within %cs2 [i32* %arg1]
964 ; CHECK: catchpad within %cs2 [i32* %arg1]
965 ; CHECK-NEXT: br label %normal
968 %cs3 = catchswitch within none [label %catchpad3] unwind label %cleanuppad1
971 catchpad within %cs3 [i32* %arg1, i32* %arg2]
973 ; CHECK: catchpad within %cs3 [i32* %arg1, i32* %arg2]
974 ; CHECK-NEXT: br label %normal
977 %clean.1 = cleanuppad within none []
979 ; CHECK: %clean.1 = cleanuppad within none []
980 ; CHECK-NEXT: unreachable
986 define i32 @instructions.win_eh.2() personality i32 -4 {
988 invoke void @f.ccc() to label %invoke.cont unwind label %catchswitch
991 invoke void @f.ccc() to label %continue unwind label %cleanup
994 %clean = cleanuppad within none []
995 ; CHECK: %clean = cleanuppad within none []
996 cleanupret from %clean unwind to caller
997 ; CHECK: cleanupret from %clean unwind to caller
1000 %cs = catchswitch within none [label %catchpad] unwind label %terminate
1003 %catch = catchpad within %cs []
1005 ; CHECK: %catch = catchpad within %cs []
1006 ; CHECK-NEXT: br label %body
1009 invoke void @f.ccc() [ "funclet"(token %catch) ]
1010 to label %continue unwind label %terminate.inner
1011 catchret from %catch to label %return
1012 ; CHECK: catchret from %catch to label %return
1018 cleanuppad within %catch []
1020 ; CHECK: cleanuppad within %catch []
1021 ; CHECK-NEXT: unreachable
1024 cleanuppad within none []
1026 ; CHECK: cleanuppad within none []
1027 ; CHECK-NEXT: unreachable
1033 ; Instructions -- Unary Operations
1034 define void @instructions.unops(double %op1) {
1036 ; CHECK: fneg double %op1
1040 ; Instructions -- Binary Operations
1041 define void @instructions.binops(i8 %op1, i8 %op2) {
1044 ; CHECK: add i8 %op1, %op2
1045 add nuw i8 %op1, %op2
1046 ; CHECK: add nuw i8 %op1, %op2
1047 add nsw i8 %op1, %op2
1048 ; CHECK: add nsw i8 %op1, %op2
1049 add nuw nsw i8 %op1, %op2
1050 ; CHECK: add nuw nsw i8 %op1, %op2
1052 ; CHECK: sub i8 %op1, %op2
1053 sub nuw i8 %op1, %op2
1054 ; CHECK: sub nuw i8 %op1, %op2
1055 sub nsw i8 %op1, %op2
1056 ; CHECK: sub nsw i8 %op1, %op2
1057 sub nuw nsw i8 %op1, %op2
1058 ; CHECK: sub nuw nsw i8 %op1, %op2
1060 ; CHECK: mul i8 %op1, %op2
1061 mul nuw i8 %op1, %op2
1062 ; CHECK: mul nuw i8 %op1, %op2
1063 mul nsw i8 %op1, %op2
1064 ; CHECK: mul nsw i8 %op1, %op2
1065 mul nuw nsw i8 %op1, %op2
1066 ; CHECK: mul nuw nsw i8 %op1, %op2
1070 ; CHECK: udiv i8 %op1, %op2
1071 udiv exact i8 %op1, %op2
1072 ; CHECK: udiv exact i8 %op1, %op2
1074 ; CHECK: sdiv i8 %op1, %op2
1075 sdiv exact i8 %op1, %op2
1076 ; CHECK: sdiv exact i8 %op1, %op2
1080 ; CHECK: urem i8 %op1, %op2
1082 ; CHECK: srem i8 %op1, %op2
1087 ; Instructions -- Bitwise Binary Operations
1088 define void @instructions.bitwise_binops(i8 %op1, i8 %op2) {
1091 ; CHECK: shl i8 %op1, %op2
1092 shl nuw i8 %op1, %op2
1093 ; CHECK: shl nuw i8 %op1, %op2
1094 shl nsw i8 %op1, %op2
1095 ; CHECK: shl nsw i8 %op1, %op2
1096 shl nuw nsw i8 %op1, %op2
1097 ; CHECK: shl nuw nsw i8 %op1, %op2
1101 ; CHECK: lshr i8 %op1, %op2
1102 lshr exact i8 %op1, %op2
1103 ; CHECK: lshr exact i8 %op1, %op2
1105 ; CHECK: ashr i8 %op1, %op2
1106 ashr exact i8 %op1, %op2
1107 ; CHECK: ashr exact i8 %op1, %op2
1111 ; CHECK: and i8 %op1, %op2
1113 ; CHECK: or i8 %op1, %op2
1115 ; CHECK: xor i8 %op1, %op2
1120 ; Instructions -- Vector Operations
1121 define void @instructions.vectorops(<4 x float> %vec, <4 x float> %vec2) {
1122 extractelement <4 x float> %vec, i8 0
1123 ; CHECK: extractelement <4 x float> %vec, i8 0
1124 insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1125 ; CHECK: insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1126 shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1127 ; CHECK: shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1132 ; Instructions -- Aggregate Operations
1133 define void @instructions.aggregateops({ i8, i32 } %up, <{ i8, i32 }> %p,
1134 [3 x i8] %arr, { i8, { i32 }} %n,
1135 <2 x i8*> %pvec, <2 x i64> %offsets) {
1136 extractvalue { i8, i32 } %up, 0
1137 ; CHECK: extractvalue { i8, i32 } %up, 0
1138 extractvalue <{ i8, i32 }> %p, 1
1139 ; CHECK: extractvalue <{ i8, i32 }> %p, 1
1140 extractvalue [3 x i8] %arr, 2
1141 ; CHECK: extractvalue [3 x i8] %arr, 2
1142 extractvalue { i8, { i32 } } %n, 1, 0
1143 ; CHECK: extractvalue { i8, { i32 } } %n, 1, 0
1145 insertvalue { i8, i32 } %up, i8 1, 0
1146 ; CHECK: insertvalue { i8, i32 } %up, i8 1, 0
1147 insertvalue <{ i8, i32 }> %p, i32 2, 1
1148 ; CHECK: insertvalue <{ i8, i32 }> %p, i32 2, 1
1149 insertvalue [3 x i8] %arr, i8 0, 0
1150 ; CHECK: insertvalue [3 x i8] %arr, i8 0, 0
1151 insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1152 ; CHECK: insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1154 %up.ptr = alloca { i8, i32 }
1155 %p.ptr = alloca <{ i8, i32 }>
1156 %arr.ptr = alloca [3 x i8]
1157 %n.ptr = alloca { i8, { i32 } }
1159 getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
1160 ; CHECK: getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
1161 getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
1162 ; CHECK: getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
1163 getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
1164 ; CHECK: getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
1165 getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
1166 ; CHECK: getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
1167 getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
1168 ; CHECK: getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
1169 getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
1170 ; CHECK: getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
1175 ; Instructions -- Memory Access and Addressing Operations
1179 define void @instructions.memops(i32** %base) {
1180 alloca i32, i8 4, align 4
1181 ; CHECK: alloca i32, i8 4, align 4
1182 alloca inalloca i32, i8 4, align 4
1183 ; CHECK: alloca inalloca i32, i8 4, align 4
1185 load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1186 ; CHECK: load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1187 load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1188 ; CHECK: load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1190 store i32* null, i32** %base, align 4, !nontemporal !8
1191 ; CHECK: store i32* null, i32** %base, align 4, !nontemporal !8
1192 store volatile i32* null, i32** %base, align 4, !nontemporal !8
1193 ; CHECK: store volatile i32* null, i32** %base, align 4, !nontemporal !8
1198 ; Instructions -- Conversion Operations
1199 define void @instructions.conversions() {
1201 ; CHECK: trunc i32 -1 to i1
1203 ; CHECK: zext i32 -1 to i64
1205 ; CHECK: sext i32 -1 to i64
1206 fptrunc float undef to half
1207 ; CHECK: fptrunc float undef to half
1208 fpext half undef to float
1209 ; CHECK: fpext half undef to float
1210 fptoui float undef to i32
1211 ; CHECK: fptoui float undef to i32
1212 fptosi float undef to i32
1213 ; CHECK: fptosi float undef to i32
1214 uitofp i32 1 to float
1215 ; CHECK: uitofp i32 1 to float
1216 sitofp i32 -1 to float
1217 ; CHECK: sitofp i32 -1 to float
1218 ptrtoint i8* null to i64
1219 ; CHECK: ptrtoint i8* null to i64
1220 inttoptr i64 0 to i8*
1221 ; CHECK: inttoptr i64 0 to i8*
1222 bitcast i32 0 to i32
1223 ; CHECK: bitcast i32 0 to i32
1224 addrspacecast i32* null to i32 addrspace(1)*
1225 ; CHECK: addrspacecast i32* null to i32 addrspace(1)*
1230 ; Instructions -- Other Operations
1231 define void @instructions.other(i32 %op1, i32 %op2, half %fop1, half %fop2) {
1233 icmp eq i32 %op1, %op2
1234 ; CHECK: icmp eq i32 %op1, %op2
1235 icmp ne i32 %op1, %op2
1236 ; CHECK: icmp ne i32 %op1, %op2
1237 icmp ugt i32 %op1, %op2
1238 ; CHECK: icmp ugt i32 %op1, %op2
1239 icmp uge i32 %op1, %op2
1240 ; CHECK: icmp uge i32 %op1, %op2
1241 icmp ult i32 %op1, %op2
1242 ; CHECK: icmp ult i32 %op1, %op2
1243 icmp ule i32 %op1, %op2
1244 ; CHECK: icmp ule i32 %op1, %op2
1245 icmp sgt i32 %op1, %op2
1246 ; CHECK: icmp sgt i32 %op1, %op2
1247 icmp sge i32 %op1, %op2
1248 ; CHECK: icmp sge i32 %op1, %op2
1249 icmp slt i32 %op1, %op2
1250 ; CHECK: icmp slt i32 %op1, %op2
1251 icmp sle i32 %op1, %op2
1252 ; CHECK: icmp sle i32 %op1, %op2
1254 fcmp false half %fop1, %fop2
1255 ; CHECK: fcmp false half %fop1, %fop2
1256 fcmp oeq half %fop1, %fop2
1257 ; CHECK: fcmp oeq half %fop1, %fop2
1258 fcmp ogt half %fop1, %fop2
1259 ; CHECK: fcmp ogt half %fop1, %fop2
1260 fcmp oge half %fop1, %fop2
1261 ; CHECK: fcmp oge half %fop1, %fop2
1262 fcmp olt half %fop1, %fop2
1263 ; CHECK: fcmp olt half %fop1, %fop2
1264 fcmp ole half %fop1, %fop2
1265 ; CHECK: fcmp ole half %fop1, %fop2
1266 fcmp one half %fop1, %fop2
1267 ; CHECK: fcmp one half %fop1, %fop2
1268 fcmp ord half %fop1, %fop2
1269 ; CHECK: fcmp ord half %fop1, %fop2
1270 fcmp ueq half %fop1, %fop2
1271 ; CHECK: fcmp ueq half %fop1, %fop2
1272 fcmp ugt half %fop1, %fop2
1273 ; CHECK: fcmp ugt half %fop1, %fop2
1274 fcmp uge half %fop1, %fop2
1275 ; CHECK: fcmp uge half %fop1, %fop2
1276 fcmp ult half %fop1, %fop2
1277 ; CHECK: fcmp ult half %fop1, %fop2
1278 fcmp ule half %fop1, %fop2
1279 ; CHECK: fcmp ule half %fop1, %fop2
1280 fcmp une half %fop1, %fop2
1281 ; CHECK: fcmp une half %fop1, %fop2
1282 fcmp uno half %fop1, %fop2
1283 ; CHECK: fcmp uno half %fop1, %fop2
1284 fcmp true half %fop1, %fop2
1285 ; CHECK: fcmp true half %fop1, %fop2
1289 %v1 = add i32 %op1, %op2
1292 %v2 = add i32 %op1, %op2
1295 phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1296 ; CHECK: phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1298 select i1 true, i32 0, i32 1
1299 ; CHECK: select i1 true, i32 0, i32 1
1300 select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1301 ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1303 call void @f.nobuiltin() builtin
1304 ; CHECK: call void @f.nobuiltin() #42
1306 call void @f.strictfp() strictfp
1307 ; CHECK: call void @f.strictfp() #43
1309 call fastcc noalias i32* @f.noalias() noinline
1310 ; CHECK: call fastcc noalias i32* @f.noalias() #12
1311 tail call ghccc nonnull i32* @f.nonnull() minsize
1312 ; CHECK: tail call ghccc nonnull i32* @f.nonnull() #7
1317 define void @instructions.call_musttail(i8* inalloca %val) {
1318 musttail call void @f.param.inalloca(i8* inalloca %val)
1319 ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val)
1324 define void @instructions.call_notail() {
1325 notail call void @f1()
1326 ; CHECK: notail call void @f1()
1331 define void @instructions.landingpad() personality i32 -2 {
1332 invoke void @llvm.donothing() to label %proceed unwind label %catch1
1333 invoke void @llvm.donothing() to label %proceed unwind label %catch2
1334 invoke void @llvm.donothing() to label %proceed unwind label %catch3
1335 invoke void @llvm.donothing() to label %proceed unwind label %catch4
1339 ; CHECK: landingpad i32
1346 ; CHECK: landingpad i32
1350 ; CHECK: catch i32* null
1355 ; CHECK: landingpad i32
1359 ; CHECK: catch i32* null
1361 ; CHECK: catch i32* null
1366 ; CHECK: landingpad i32
1367 filter [2 x i32] zeroinitializer
1368 ; CHECK: filter [2 x i32] zeroinitializer
1375 ;; Intrinsic Functions
1377 ; Intrinsic Functions -- Variable Argument Handling
1378 declare void @llvm.va_start(i8*)
1379 declare void @llvm.va_copy(i8*, i8*)
1380 declare void @llvm.va_end(i8*)
1381 define void @instructions.va_arg(i8* %v, ...) {
1383 %ap2 = bitcast i8** %ap to i8*
1385 call void @llvm.va_start(i8* %ap2)
1386 ; CHECK: call void @llvm.va_start(i8* %ap2)
1388 va_arg i8* %ap2, i32
1389 ; CHECK: va_arg i8* %ap2, i32
1391 call void @llvm.va_copy(i8* %v, i8* %ap2)
1392 ; CHECK: call void @llvm.va_copy(i8* %v, i8* %ap2)
1394 call void @llvm.va_end(i8* %ap2)
1395 ; CHECK: call void @llvm.va_end(i8* %ap2)
1400 ; Intrinsic Functions -- Accurate Garbage Collection
1401 declare void @llvm.gcroot(i8**, i8*)
1402 declare i8* @llvm.gcread(i8*, i8**)
1403 declare void @llvm.gcwrite(i8*, i8*, i8**)
1404 define void @intrinsics.gc() gc "shadow-stack" {
1405 %ptrloc = alloca i8*
1406 call void @llvm.gcroot(i8** %ptrloc, i8* null)
1407 ; CHECK: call void @llvm.gcroot(i8** %ptrloc, i8* null)
1409 call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1410 ; CHECK: call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1413 call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1414 ; CHECK: call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1419 ; Intrinsic Functions -- Code Generation
1420 declare i8* @llvm.returnaddress(i32)
1421 declare i8* @llvm.frameaddress(i32)
1422 declare i32 @llvm.read_register.i32(metadata)
1423 declare i64 @llvm.read_register.i64(metadata)
1424 declare void @llvm.write_register.i32(metadata, i32)
1425 declare void @llvm.write_register.i64(metadata, i64)
1426 declare i8* @llvm.stacksave()
1427 declare void @llvm.stackrestore(i8*)
1428 declare void @llvm.prefetch(i8*, i32, i32, i32)
1429 declare void @llvm.pcmarker(i32)
1430 declare i64 @llvm.readcyclecounter()
1431 declare void @llvm.clear_cache(i8*, i8*)
1432 declare void @llvm.instrprof_increment(i8*, i64, i32, i32)
1435 define void @intrinsics.codegen() {
1436 call i8* @llvm.returnaddress(i32 1)
1437 ; CHECK: call i8* @llvm.returnaddress(i32 1)
1438 call i8* @llvm.frameaddress(i32 1)
1439 ; CHECK: call i8* @llvm.frameaddress(i32 1)
1441 call i32 @llvm.read_register.i32(metadata !10)
1442 ; CHECK: call i32 @llvm.read_register.i32(metadata !10)
1443 call i64 @llvm.read_register.i64(metadata !10)
1444 ; CHECK: call i64 @llvm.read_register.i64(metadata !10)
1445 call void @llvm.write_register.i32(metadata !10, i32 0)
1446 ; CHECK: call void @llvm.write_register.i32(metadata !10, i32 0)
1447 call void @llvm.write_register.i64(metadata !10, i64 0)
1448 ; CHECK: call void @llvm.write_register.i64(metadata !10, i64 0)
1450 %stack = call i8* @llvm.stacksave()
1451 ; CHECK: %stack = call i8* @llvm.stacksave()
1452 call void @llvm.stackrestore(i8* %stack)
1453 ; CHECK: call void @llvm.stackrestore(i8* %stack)
1455 call void @llvm.prefetch(i8* %stack, i32 0, i32 3, i32 0)
1456 ; CHECK: call void @llvm.prefetch(i8* %stack, i32 0, i32 3, i32 0)
1458 call void @llvm.pcmarker(i32 1)
1459 ; CHECK: call void @llvm.pcmarker(i32 1)
1461 call i64 @llvm.readcyclecounter()
1462 ; CHECK: call i64 @llvm.readcyclecounter()
1464 call void @llvm.clear_cache(i8* null, i8* null)
1465 ; CHECK: call void @llvm.clear_cache(i8* null, i8* null)
1467 call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1468 ; CHECK: call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1473 declare void @llvm.localescape(...)
1474 declare i8* @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
1475 define void @intrinsics.localescape() {
1476 %static.alloca = alloca i32
1477 call void (...) @llvm.localescape(i32* %static.alloca)
1478 ; CHECK: call void (...) @llvm.localescape(i32* %static.alloca)
1480 call void @intrinsics.localrecover()
1484 define void @intrinsics.localrecover() {
1485 %func = bitcast void ()* @intrinsics.localescape to i8*
1486 %fp = call i8* @llvm.frameaddress(i32 1)
1487 call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1488 ; CHECK: call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1493 ; We need this function to provide `uses' for some metadata tests.
1494 define void @misc.metadata() {
1495 call void @f1(), !srcloc !11
1496 call void @f1(), !srcloc !12
1497 call void @f1(), !srcloc !13
1498 call void @f1(), !srcloc !14
1502 declare void @op_bundle_callee_0()
1503 declare void @op_bundle_callee_1(i32,i32)
1505 define void @call_with_operand_bundle0(i32* %ptr) {
1506 ; CHECK-LABEL: call_with_operand_bundle0(
1508 %l = load i32, i32* %ptr
1510 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1511 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1515 define void @call_with_operand_bundle1(i32* %ptr) {
1516 ; CHECK-LABEL: call_with_operand_bundle1(
1518 %l = load i32, i32* %ptr
1521 call void @op_bundle_callee_0()
1522 call void @op_bundle_callee_0() [ "foo"() ]
1523 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1524 ; CHECK: @op_bundle_callee_0(){{$}}
1525 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"() ]
1526 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1530 define void @call_with_operand_bundle2(i32* %ptr) {
1531 ; CHECK-LABEL: call_with_operand_bundle2(
1533 call void @op_bundle_callee_0() [ "foo"() ]
1534 ; CHECK: call void @op_bundle_callee_0() [ "foo"() ]
1538 define void @call_with_operand_bundle3(i32* %ptr) {
1539 ; CHECK-LABEL: call_with_operand_bundle3(
1541 %l = load i32, i32* %ptr
1543 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1544 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1548 define void @call_with_operand_bundle4(i32* %ptr) {
1549 ; CHECK-LABEL: call_with_operand_bundle4(
1551 %l = load i32, i32* %ptr
1553 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) ]
1554 ; 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) ]
1558 ; Invoke versions of the above tests:
1561 define void @invoke_with_operand_bundle0(i32* %ptr) personality i8 3 {
1562 ; CHECK-LABEL: @invoke_with_operand_bundle0(
1564 %l = load i32, i32* %ptr
1566 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
1567 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1570 %cleanup = landingpad i8 cleanup
1576 define void @invoke_with_operand_bundle1(i32* %ptr) personality i8 3 {
1577 ; CHECK-LABEL: @invoke_with_operand_bundle1(
1579 %l = load i32, i32* %ptr
1582 invoke void @op_bundle_callee_0() to label %normal unwind label %exception
1583 ; CHECK: invoke void @op_bundle_callee_0(){{$}}
1586 %cleanup = landingpad i8 cleanup
1590 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal1 unwind label %exception1
1591 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1594 %cleanup1 = landingpad i8 cleanup
1598 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
1599 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1602 %cleanup2 = landingpad i8 cleanup
1609 define void @invoke_with_operand_bundle2(i32* %ptr) personality i8 3 {
1610 ; CHECK-LABEL: @invoke_with_operand_bundle2(
1612 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal unwind label %exception
1613 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1616 %cleanup = landingpad i8 cleanup
1622 define void @invoke_with_operand_bundle3(i32* %ptr) personality i8 3 {
1623 ; CHECK-LABEL: @invoke_with_operand_bundle3(
1625 %l = load i32, i32* %ptr
1627 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
1628 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1631 %cleanup = landingpad i8 cleanup
1637 define void @invoke_with_operand_bundle4(i32* %ptr) personality i8 3 {
1638 ; CHECK-LABEL: @invoke_with_operand_bundle4(
1640 %l = load i32, i32* %ptr
1642 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) ]
1643 to label %normal unwind label %exception
1644 ; 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) ]
1647 %cleanup = landingpad i8 cleanup
1653 declare void @vaargs_func(...)
1654 define void @invoke_with_operand_bundle_vaarg(i32* %ptr) personality i8 3 {
1655 ; CHECK-LABEL: @invoke_with_operand_bundle_vaarg(
1657 %l = load i32, i32* %ptr
1659 invoke void (...) @vaargs_func(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1660 to label %normal unwind label %exception
1661 ; 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) ]
1664 %cleanup = landingpad i8 cleanup
1671 declare void @f.writeonly() writeonly
1672 ; CHECK: declare void @f.writeonly() #40
1674 declare void @f.speculatable() speculatable
1675 ; CHECK: declare void @f.speculatable() #41
1677 ;; Constant Expressions
1679 define i8** @constexpr() {
1680 ; 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)
1681 ret i8** getelementptr inbounds ({ [4 x i8*], [4 x i8*] }, { [4 x i8*], [4 x i8*] }* null, i32 0, inrange i32 1, i32 2)
1684 ; CHECK: attributes #0 = { alignstack=4 }
1685 ; CHECK: attributes #1 = { alignstack=8 }
1686 ; CHECK: attributes #2 = { alwaysinline }
1687 ; CHECK: attributes #3 = { cold }
1688 ; CHECK: attributes #4 = { convergent }
1689 ; CHECK: attributes #5 = { inlinehint }
1690 ; CHECK: attributes #6 = { jumptable }
1691 ; CHECK: attributes #7 = { minsize }
1692 ; CHECK: attributes #8 = { naked }
1693 ; CHECK: attributes #9 = { nobuiltin }
1694 ; CHECK: attributes #10 = { noduplicate }
1695 ; CHECK: attributes #11 = { noimplicitfloat }
1696 ; CHECK: attributes #12 = { noinline }
1697 ; CHECK: attributes #13 = { nonlazybind }
1698 ; CHECK: attributes #14 = { noredzone }
1699 ; CHECK: attributes #15 = { noreturn }
1700 ; CHECK: attributes #16 = { nounwind }
1701 ; CHECK: attributes #17 = { noinline optnone }
1702 ; CHECK: attributes #18 = { optsize }
1703 ; CHECK: attributes #19 = { readnone }
1704 ; CHECK: attributes #20 = { readonly }
1705 ; CHECK: attributes #21 = { returns_twice }
1706 ; CHECK: attributes #22 = { safestack }
1707 ; CHECK: attributes #23 = { sanitize_address }
1708 ; CHECK: attributes #24 = { sanitize_memory }
1709 ; CHECK: attributes #25 = { sanitize_thread }
1710 ; CHECK: attributes #26 = { ssp }
1711 ; CHECK: attributes #27 = { sspreq }
1712 ; CHECK: attributes #28 = { sspstrong }
1713 ; CHECK: attributes #29 = { "thunk" }
1714 ; CHECK: attributes #30 = { uwtable }
1715 ; CHECK: attributes #31 = { "cpu"="cortex-a8" }
1716 ; CHECK: attributes #32 = { norecurse }
1717 ; CHECK: attributes #33 = { inaccessiblememonly }
1718 ; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly }
1719 ; CHECK: attributes #35 = { nounwind readnone }
1720 ; CHECK: attributes #36 = { argmemonly nounwind readonly }
1721 ; CHECK: attributes #37 = { argmemonly nounwind }
1722 ; CHECK: attributes #38 = { nounwind readonly }
1723 ; CHECK: attributes #39 = { inaccessiblemem_or_argmemonly nounwind }
1724 ; CHECK: attributes #40 = { writeonly }
1725 ; CHECK: attributes #41 = { speculatable }
1726 ; CHECK: attributes #42 = { builtin }
1727 ; CHECK: attributes #43 = { strictfp }
1731 ; Metadata -- Module flags
1732 !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1733 ; CHECK: !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1735 !0 = !{i32 1, !"mod1", i32 0}
1736 ; CHECK: !0 = !{i32 1, !"mod1", i32 0}
1737 !1 = !{i32 2, !"mod2", i32 0}
1738 ; CHECK: !1 = !{i32 2, !"mod2", i32 0}
1739 !2 = !{i32 3, !"mod3", !3}
1740 ; CHECK: !2 = !{i32 3, !"mod3", !3}
1742 ; CHECK: !3 = !{!"mod6", !0}
1743 !4 = !{i32 4, !"mod4", i32 0}
1744 ; CHECK: !4 = !{i32 4, !"mod4", i32 0}
1745 !5 = !{i32 5, !"mod5", !0}
1746 ; CHECK: !5 = !{i32 5, !"mod5", !0}
1747 !6 = !{i32 6, !"mod6", !0}
1748 ; CHECK: !6 = !{i32 6, !"mod6", !0}
1750 ; Metadata -- Check `distinct'
1752 ; CHECK: !11 = distinct !{}
1754 ; CHECK: !12 = distinct !{}
1756 ; CHECK: !13 = !{!11}
1758 ; CHECK: !14 = !{!12}