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 -- partition
164 @g.partition = global i32 0, partition "part"
165 ; CHECK: @g.partition = global i32 0, partition "part"
167 ; Global Variables -- comdat
168 @comdat.any = global i32 0, comdat
169 ; CHECK: @comdat.any = global i32 0, comdat
170 @comdat.exactmatch = global i32 0, comdat
171 ; CHECK: @comdat.exactmatch = global i32 0, comdat
172 @comdat.largest = global i32 0, comdat
173 ; CHECK: @comdat.largest = global i32 0, comdat
174 @comdat.noduplicates = global i32 0, comdat
175 ; CHECK: @comdat.noduplicates = global i32 0, comdat
176 @comdat.samesize = global i32 0, comdat
177 ; CHECK: @comdat.samesize = global i32 0, comdat
179 ; Force two globals from different comdats into sections with the same name.
180 $comdat1 = comdat any
181 $comdat2 = comdat any
182 @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
183 ; CHECK: @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
184 @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
185 ; CHECK: @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
187 ; Global Variables -- align
188 @g.align = global i32 0, align 4
189 ; CHECK: @g.align = global i32 0, align 4
191 ; Global Variables -- Intrinsics
192 %pri.func.data = type { i32, void ()*, i8* }
193 @g.used1 = global i32 0
194 @g.used2 = global i32 0
195 @g.used3 = global i8 0
197 @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
198 ; CHECK: @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
199 @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
200 ; CHECK: @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
201 @llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
202 ; 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"
203 @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
204 ; 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"
207 ; Format: @<Name> = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
208 ; [unnamed_addr] alias <AliaseeTy> @<Aliasee>
211 @a.private = private alias i32, i32* @g.private
212 ; CHECK: @a.private = private alias i32, i32* @g.private
213 @a.internal = internal alias i32, i32* @g.internal
214 ; CHECK: @a.internal = internal alias i32, i32* @g.internal
215 @a.linkonce = linkonce alias i32, i32* @g.linkonce
216 ; CHECK: @a.linkonce = linkonce alias i32, i32* @g.linkonce
217 @a.weak = weak alias i32, i32* @g.weak
218 ; CHECK: @a.weak = weak alias i32, i32* @g.weak
219 @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
220 ; CHECK: @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
221 @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
222 ; CHECK: @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
223 @a.external = external alias i32, i32* @g1
224 ; CHECK: @a.external = alias i32, i32* @g1
226 ; Aliases -- Visibility
227 @a.default = default alias i32, i32* @g.default
228 ; CHECK: @a.default = alias i32, i32* @g.default
229 @a.hidden = hidden alias i32, i32* @g.hidden
230 ; CHECK: @a.hidden = hidden alias i32, i32* @g.hidden
231 @a.protected = protected alias i32, i32* @g.protected
232 ; CHECK: @a.protected = protected alias i32, i32* @g.protected
234 ; Aliases -- DLLStorageClass
235 @a.dlldefault = default alias i32, i32* @g.dlldefault
236 ; CHECK: @a.dlldefault = alias i32, i32* @g.dlldefault
237 @a.dllexport = dllexport alias i32, i32* @g.dllexport
238 ; CHECK: @a.dllexport = dllexport alias i32, i32* @g.dllexport
240 ; Aliases -- ThreadLocal
241 @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
242 ; CHECK: @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
243 @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
244 ; CHECK: @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
245 @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
246 ; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
247 @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
248 ; CHECK: @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
249 @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
250 ; CHECK: @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
252 ; Aliases -- unnamed_addr and local_unnamed_addr
253 @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
254 ; CHECK: @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
255 @a.local_unnamed_addr = local_unnamed_addr alias i32, i32* @g.local_unnamed_addr
256 ; CHECK: @a.local_unnamed_addr = local_unnamed_addr alias i32, i32* @g.local_unnamed_addr
258 ; Aliases -- partition
259 ; CHECK: @alias.partition = alias i32, i32* @g.partition, partition "part"
260 @alias.partition = alias i32, i32* @g.partition, partition "part"
263 ; Format @<Name> = [Linkage] [Visibility] ifunc <IFuncTy>,
264 ; <ResolverTy>* @<Resolver>
267 @ifunc.external = external ifunc void (), i8* ()* @ifunc_resolver
268 ; CHECK: @ifunc.external = ifunc void (), i8* ()* @ifunc_resolver
269 @ifunc.private = private ifunc void (), i8* ()* @ifunc_resolver
270 ; CHECK: @ifunc.private = private ifunc void (), i8* ()* @ifunc_resolver
271 @ifunc.internal = internal ifunc void (), i8* ()* @ifunc_resolver
272 ; CHECK: @ifunc.internal = internal ifunc void (), i8* ()* @ifunc_resolver
274 ; IFunc -- Visibility
275 @ifunc.default = default ifunc void (), i8* ()* @ifunc_resolver
276 ; CHECK: @ifunc.default = ifunc void (), i8* ()* @ifunc_resolver
277 @ifunc.hidden = hidden ifunc void (), i8* ()* @ifunc_resolver
278 ; CHECK: @ifunc.hidden = hidden ifunc void (), i8* ()* @ifunc_resolver
279 @ifunc.protected = protected ifunc void (), i8* ()* @ifunc_resolver
280 ; CHECK: @ifunc.protected = protected ifunc void (), i8* ()* @ifunc_resolver
283 ; CHECK: @ifunc.partition = ifunc void (), i8* ()* @ifunc_resolver, partition "part"
284 @ifunc.partition = ifunc void (), i8* ()* @ifunc_resolver, partition "part"
286 define i8* @ifunc_resolver() {
292 ; Format: define [linkage] [visibility] [DLLStorageClass]
293 ; [cconv] [ret attrs]
294 ; <ResultType> @<FunctionName> ([argument list])
295 ; [(unnamed_addr|local_unnamed_addr)] [fn Attrs] [section "name"] [comdat [($name)]]
296 ; [align N] [gc] [prefix Constant] [prologue Constant]
297 ; [personality Constant] { ... }
299 ; Functions -- Simple
301 ; CHECK: declare void @f1()
304 ; CHECK: define void @f2()
309 ; Functions -- linkage
310 define private void @f.private() {
311 ; CHECK: define private void @f.private()
315 define internal void @f.internal() {
316 ; CHECK: define internal void @f.internal()
320 define available_externally void @f.available_externally() {
321 ; CHECK: define available_externally void @f.available_externally()
325 define linkonce void @f.linkonce() {
326 ; CHECK: define linkonce void @f.linkonce()
330 define weak void @f.weak() {
331 ; CHECK: define weak void @f.weak()
335 define linkonce_odr void @f.linkonce_odr() {
336 ; CHECK: define linkonce_odr void @f.linkonce_odr()
340 define weak_odr void @f.weak_odr() {
341 ; CHECK: define weak_odr void @f.weak_odr()
345 declare external void @f.external()
346 ; CHECK: declare void @f.external()
347 declare extern_weak void @f.extern_weak()
348 ; CHECK: declare extern_weak void @f.extern_weak()
350 ; Functions -- visibility
351 declare default void @f.default()
352 ; CHECK: declare void @f.default()
353 declare hidden void @f.hidden()
354 ; CHECK: declare hidden void @f.hidden()
355 declare protected void @f.protected()
356 ; CHECK: declare protected void @f.protected()
358 ; Functions -- DLLStorageClass
359 declare dllimport void @f.dllimport()
360 ; CHECK: declare dllimport void @f.dllimport()
361 declare dllexport void @f.dllexport()
362 ; CHECK: declare dllexport void @f.dllexport()
364 ; Functions -- cconv (Calling conventions)
365 declare ccc void @f.ccc()
366 ; CHECK: declare void @f.ccc()
367 declare fastcc void @f.fastcc()
368 ; CHECK: declare fastcc void @f.fastcc()
369 declare coldcc void @f.coldcc()
370 ; CHECK: declare coldcc void @f.coldcc()
371 declare cc10 void @f.cc10()
372 ; CHECK: declare ghccc void @f.cc10()
373 declare ghccc void @f.ghccc()
374 ; CHECK: declare ghccc void @f.ghccc()
375 declare cc11 void @f.cc11()
376 ; CHECK: declare cc11 void @f.cc11()
377 declare webkit_jscc void @f.webkit_jscc()
378 ; CHECK: declare webkit_jscc void @f.webkit_jscc()
379 declare anyregcc void @f.anyregcc()
380 ; CHECK: declare anyregcc void @f.anyregcc()
381 declare preserve_mostcc void @f.preserve_mostcc()
382 ; CHECK: declare preserve_mostcc void @f.preserve_mostcc()
383 declare preserve_allcc void @f.preserve_allcc()
384 ; CHECK: declare preserve_allcc void @f.preserve_allcc()
385 declare cc64 void @f.cc64()
386 ; CHECK: declare x86_stdcallcc void @f.cc64()
387 declare x86_stdcallcc void @f.x86_stdcallcc()
388 ; CHECK: declare x86_stdcallcc void @f.x86_stdcallcc()
389 declare cc65 void @f.cc65()
390 ; CHECK: declare x86_fastcallcc void @f.cc65()
391 declare x86_fastcallcc void @f.x86_fastcallcc()
392 ; CHECK: declare x86_fastcallcc void @f.x86_fastcallcc()
393 declare cc66 void @f.cc66()
394 ; CHECK: declare arm_apcscc void @f.cc66()
395 declare arm_apcscc void @f.arm_apcscc()
396 ; CHECK: declare arm_apcscc void @f.arm_apcscc()
397 declare cc67 void @f.cc67()
398 ; CHECK: declare arm_aapcscc void @f.cc67()
399 declare arm_aapcscc void @f.arm_aapcscc()
400 ; CHECK: declare arm_aapcscc void @f.arm_aapcscc()
401 declare cc68 void @f.cc68()
402 ; CHECK: declare arm_aapcs_vfpcc void @f.cc68()
403 declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
404 ; CHECK: declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
405 declare cc69 void @f.cc69()
406 ; CHECK: declare msp430_intrcc void @f.cc69()
407 declare msp430_intrcc void @f.msp430_intrcc()
408 ; CHECK: declare msp430_intrcc void @f.msp430_intrcc()
409 declare cc70 void @f.cc70()
410 ; CHECK: declare x86_thiscallcc void @f.cc70()
411 declare x86_thiscallcc void @f.x86_thiscallcc()
412 ; CHECK: declare x86_thiscallcc void @f.x86_thiscallcc()
413 declare cc71 void @f.cc71()
414 ; CHECK: declare ptx_kernel void @f.cc71()
415 declare ptx_kernel void @f.ptx_kernel()
416 ; CHECK: declare ptx_kernel void @f.ptx_kernel()
417 declare cc72 void @f.cc72()
418 ; CHECK: declare ptx_device void @f.cc72()
419 declare ptx_device void @f.ptx_device()
420 ; CHECK: declare ptx_device void @f.ptx_device()
421 declare cc75 void @f.cc75()
422 ; CHECK: declare spir_func void @f.cc75()
423 declare spir_func void @f.spir_func()
424 ; CHECK: declare spir_func void @f.spir_func()
425 declare cc76 void @f.cc76()
426 ; CHECK: declare spir_kernel void @f.cc76()
427 declare spir_kernel void @f.spir_kernel()
428 ; CHECK: declare spir_kernel void @f.spir_kernel()
429 declare cc77 void @f.cc77()
430 ; CHECK: declare intel_ocl_bicc void @f.cc77()
431 declare intel_ocl_bicc void @f.intel_ocl_bicc()
432 ; CHECK: declare intel_ocl_bicc void @f.intel_ocl_bicc()
433 declare cc78 void @f.cc78()
434 ; CHECK: declare x86_64_sysvcc void @f.cc78()
435 declare x86_64_sysvcc void @f.x86_64_sysvcc()
436 ; CHECK: declare x86_64_sysvcc void @f.x86_64_sysvcc()
437 declare cc79 void @f.cc79()
438 ; CHECK: declare win64cc void @f.cc79()
439 declare win64cc void @f.win64cc()
440 ; CHECK: declare win64cc void @f.win64cc()
441 declare cc80 void @f.cc80()
442 ; CHECK: declare x86_vectorcallcc void @f.cc80()
443 declare x86_vectorcallcc void @f.x86_vectorcallcc()
444 ; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc()
445 declare cc81 void @f.cc81()
446 ; CHECK: declare hhvmcc void @f.cc81()
447 declare hhvmcc void @f.hhvmcc()
448 ; CHECK: declare hhvmcc void @f.hhvmcc()
449 declare cc82 void @f.cc82()
450 ; CHECK: declare hhvm_ccc void @f.cc82()
451 declare hhvm_ccc void @f.hhvm_ccc()
452 ; CHECK: declare hhvm_ccc void @f.hhvm_ccc()
453 declare cc83 void @f.cc83()
454 ; CHECK: declare x86_intrcc void @f.cc83()
455 declare x86_intrcc void @f.x86_intrcc()
456 ; CHECK: declare x86_intrcc void @f.x86_intrcc()
457 declare cc84 void @f.cc84()
458 ; CHECK: declare avr_intrcc void @f.cc84()
459 declare avr_intrcc void @f.avr_intrcc()
460 ; CHECK: declare avr_intrcc void @f.avr_intrcc()
461 declare cc85 void @f.cc85()
462 ; CHECK: declare avr_signalcc void @f.cc85()
463 declare avr_signalcc void @f.avr_signalcc()
464 ; CHECK: declare avr_signalcc void @f.avr_signalcc()
465 declare cc87 void @f.cc87()
466 ; CHECK: declare amdgpu_vs void @f.cc87()
467 declare amdgpu_vs void @f.amdgpu_vs()
468 ; CHECK: declare amdgpu_vs void @f.amdgpu_vs()
469 declare cc88 void @f.cc88()
470 ; CHECK: declare amdgpu_gs void @f.cc88()
471 declare amdgpu_gs void @f.amdgpu_gs()
472 ; CHECK: declare amdgpu_gs void @f.amdgpu_gs()
473 declare cc89 void @f.cc89()
474 ; CHECK: declare amdgpu_ps void @f.cc89()
475 declare amdgpu_ps void @f.amdgpu_ps()
476 ; CHECK: declare amdgpu_ps void @f.amdgpu_ps()
477 declare cc90 void @f.cc90()
478 ; CHECK: declare amdgpu_cs void @f.cc90()
479 declare amdgpu_cs void @f.amdgpu_cs()
480 ; CHECK: declare amdgpu_cs void @f.amdgpu_cs()
481 declare cc91 void @f.cc91()
482 ; CHECK: declare amdgpu_kernel void @f.cc91()
483 declare amdgpu_kernel void @f.amdgpu_kernel()
484 ; CHECK: declare amdgpu_kernel void @f.amdgpu_kernel()
485 declare cc93 void @f.cc93()
486 ; CHECK: declare amdgpu_hs void @f.cc93()
487 declare amdgpu_hs void @f.amdgpu_hs()
488 ; CHECK: declare amdgpu_hs void @f.amdgpu_hs()
489 declare cc95 void @f.cc95()
490 ; CHECK: declare amdgpu_ls void @f.cc95()
491 declare amdgpu_ls void @f.amdgpu_ls()
492 ; CHECK: declare amdgpu_ls void @f.amdgpu_ls()
493 declare cc96 void @f.cc96()
494 ; CHECK: declare amdgpu_es void @f.cc96()
495 declare amdgpu_es void @f.amdgpu_es()
496 ; CHECK: declare amdgpu_es void @f.amdgpu_es()
497 declare cc1023 void @f.cc1023()
498 ; CHECK: declare cc1023 void @f.cc1023()
500 ; Functions -- ret attrs (Return attributes)
501 declare zeroext i64 @f.zeroext()
502 ; CHECK: declare zeroext i64 @f.zeroext()
503 declare signext i64 @f.signext()
504 ; CHECK: declare signext i64 @f.signext()
505 declare inreg i32* @f.inreg()
506 ; CHECK: declare inreg i32* @f.inreg()
507 declare noalias i32* @f.noalias()
508 ; CHECK: declare noalias i32* @f.noalias()
509 declare nonnull i32* @f.nonnull()
510 ; CHECK: declare nonnull i32* @f.nonnull()
511 declare dereferenceable(4) i32* @f.dereferenceable4()
512 ; CHECK: declare dereferenceable(4) i32* @f.dereferenceable4()
513 declare dereferenceable(8) i32* @f.dereferenceable8()
514 ; CHECK: declare dereferenceable(8) i32* @f.dereferenceable8()
515 declare dereferenceable(16) i32* @f.dereferenceable16()
516 ; CHECK: declare dereferenceable(16) i32* @f.dereferenceable16()
517 declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
518 ; CHECK: declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
519 declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
520 ; CHECK: declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
521 declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
522 ; CHECK: declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
524 ; Functions -- Parameter attributes
525 declare void @f.param.zeroext(i8 zeroext)
526 ; CHECK: declare void @f.param.zeroext(i8 zeroext)
527 declare void @f.param.signext(i8 signext)
528 ; CHECK: declare void @f.param.signext(i8 signext)
529 declare void @f.param.inreg(i8 inreg)
530 ; CHECK: declare void @f.param.inreg(i8 inreg)
531 declare void @f.param.byval({ i8, i8 }* byval)
532 ; CHECK: declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
533 declare void @f.param.inalloca(i8* inalloca)
534 ; CHECK: declare void @f.param.inalloca(i8* inalloca)
535 declare void @f.param.sret(i8* sret)
536 ; CHECK: declare void @f.param.sret(i8* sret)
537 declare void @f.param.noalias(i8* noalias)
538 ; CHECK: declare void @f.param.noalias(i8* noalias)
539 declare void @f.param.nocapture(i8* nocapture)
540 ; CHECK: declare void @f.param.nocapture(i8* nocapture)
541 declare void @f.param.nest(i8* nest)
542 ; CHECK: declare void @f.param.nest(i8* nest)
543 declare i8* @f.param.returned(i8* returned)
544 ; CHECK: declare i8* @f.param.returned(i8* returned)
545 declare void @f.param.nonnull(i8* nonnull)
546 ; CHECK: declare void @f.param.nonnull(i8* nonnull)
547 declare void @f.param.dereferenceable(i8* dereferenceable(4))
548 ; CHECK: declare void @f.param.dereferenceable(i8* dereferenceable(4))
549 declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
550 ; CHECK: declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
552 ; Functions -- unnamed_addr and local_unnamed_addr
553 declare void @f.unnamed_addr() unnamed_addr
554 ; CHECK: declare void @f.unnamed_addr() unnamed_addr
555 declare void @f.local_unnamed_addr() local_unnamed_addr
556 ; CHECK: declare void @f.local_unnamed_addr() local_unnamed_addr
558 ; Functions -- fn Attrs (Function attributes)
559 declare void @f.alignstack4() alignstack(4)
560 ; CHECK: declare void @f.alignstack4() #0
561 declare void @f.alignstack8() alignstack(8)
562 ; CHECK: declare void @f.alignstack8() #1
563 declare void @f.alwaysinline() alwaysinline
564 ; CHECK: declare void @f.alwaysinline() #2
565 declare void @f.cold() cold
566 ; CHECK: declare void @f.cold() #3
567 declare void @f.convergent() convergent
568 ; CHECK: declare void @f.convergent() #4
569 declare void @f.inlinehint() inlinehint
570 ; CHECK: declare void @f.inlinehint() #5
571 declare void @f.jumptable() unnamed_addr jumptable
572 ; CHECK: declare void @f.jumptable() unnamed_addr #6
573 declare void @f.minsize() minsize
574 ; CHECK: declare void @f.minsize() #7
575 declare void @f.naked() naked
576 ; CHECK: declare void @f.naked() #8
577 declare void @f.nobuiltin() nobuiltin
578 ; CHECK: declare void @f.nobuiltin() #9
579 declare void @f.noduplicate() noduplicate
580 ; CHECK: declare void @f.noduplicate() #10
581 declare void @f.noimplicitfloat() noimplicitfloat
582 ; CHECK: declare void @f.noimplicitfloat() #11
583 declare void @f.noinline() noinline
584 ; CHECK: declare void @f.noinline() #12
585 declare void @f.nonlazybind() nonlazybind
586 ; CHECK: declare void @f.nonlazybind() #13
587 declare void @f.noredzone() noredzone
588 ; CHECK: declare void @f.noredzone() #14
589 declare void @f.noreturn() noreturn
590 ; CHECK: declare void @f.noreturn() #15
591 declare void @f.nounwind() nounwind
592 ; CHECK: declare void @f.nounwind() #16
593 declare void @f.optnone() noinline optnone
594 ; CHECK: declare void @f.optnone() #17
595 declare void @f.optsize() optsize
596 ; CHECK: declare void @f.optsize() #18
597 declare void @f.readnone() readnone
598 ; CHECK: declare void @f.readnone() #19
599 declare void @f.readonly() readonly
600 ; CHECK: declare void @f.readonly() #20
601 declare void @f.returns_twice() returns_twice
602 ; CHECK: declare void @f.returns_twice() #21
603 declare void @f.safestack() safestack
604 ; CHECK: declare void @f.safestack() #22
605 declare void @f.sanitize_address() sanitize_address
606 ; CHECK: declare void @f.sanitize_address() #23
607 declare void @f.sanitize_memory() sanitize_memory
608 ; CHECK: declare void @f.sanitize_memory() #24
609 declare void @f.sanitize_thread() sanitize_thread
610 ; CHECK: declare void @f.sanitize_thread() #25
611 declare void @f.ssp() ssp
612 ; CHECK: declare void @f.ssp() #26
613 declare void @f.sspreq() sspreq
614 ; CHECK: declare void @f.sspreq() #27
615 declare void @f.sspstrong() sspstrong
616 ; CHECK: declare void @f.sspstrong() #28
617 declare void @f.thunk() "thunk"
618 ; CHECK: declare void @f.thunk() #29
619 declare void @f.uwtable() uwtable
620 ; CHECK: declare void @f.uwtable() #30
621 declare void @f.kvpair() "cpu"="cortex-a8"
622 ; CHECK:declare void @f.kvpair() #31
623 declare void @f.norecurse() norecurse
624 ; CHECK: declare void @f.norecurse() #32
625 declare void @f.inaccessiblememonly() inaccessiblememonly
626 ; CHECK: declare void @f.inaccessiblememonly() #33
627 declare void @f.inaccessiblemem_or_argmemonly() inaccessiblemem_or_argmemonly
628 ; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #34
629 declare void @f.strictfp() #35
631 ; Functions -- section
632 declare void @f.section() section "80"
633 ; CHECK: declare void @f.section() section "80"
635 ; Functions -- partition
636 define void @f.partition() partition "part" {
637 ; CHECK: define void @f.partition() partition "part"
641 ; Functions -- comdat
642 define void @f.comdat_any() comdat($comdat.any) {
643 ; CHECK: define void @f.comdat_any() comdat($comdat.any)
647 define void @f.comdat_exactmatch() comdat($comdat.exactmatch) {
648 ; CHECK: define void @f.comdat_exactmatch() comdat($comdat.exactmatch)
652 define void @f.comdat_largest() comdat($comdat.largest) {
653 ; CHECK: define void @f.comdat_largest() comdat($comdat.largest)
657 define void @f.comdat_noduplicates() comdat($comdat.noduplicates) {
658 ; CHECK: define void @f.comdat_noduplicates() comdat($comdat.noduplicates)
662 define void @f.comdat_samesize() comdat($comdat.samesize) {
663 ; CHECK: define void @f.comdat_samesize() comdat($comdat.samesize)
669 declare void @f.align2() align 2
670 ; CHECK: declare void @f.align2() align 2
671 declare void @f.align4() align 4
672 ; CHECK: declare void @f.align4() align 4
673 declare void @f.align8() align 8
674 ; CHECK: declare void @f.align8() align 8
677 declare void @f.gcshadow() gc "shadow-stack"
678 ; CHECK: declare void @f.gcshadow() gc "shadow-stack"
680 ; Functions -- Prefix data
681 declare void @f.prefixi32() prefix i32 1684365668
682 ; CHECK: declare void @f.prefixi32() prefix i32 1684365668
683 declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
684 ; CHECK: declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
686 ; Functions -- Prologue data
687 declare void @f.prologuei32() prologue i32 1684365669
688 ; CHECK: declare void @f.prologuei32() prologue i32 1684365669
689 declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
690 ; CHECK: declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
692 ; Functions -- Personality constant
693 declare void @llvm.donothing() nounwind readnone
694 ; CHECK: declare void @llvm.donothing() #35
695 define void @f.no_personality() personality i8 3 {
696 ; CHECK: define void @f.no_personality() personality i8 3
697 invoke void @llvm.donothing() to label %normal unwind label %exception
699 %cleanup = landingpad i8 cleanup
705 declare i32 @f.personality_handler()
706 ; CHECK: declare i32 @f.personality_handler()
707 define void @f.personality() personality i32 ()* @f.personality_handler {
708 ; CHECK: define void @f.personality() personality i32 ()* @f.personality_handler
709 invoke void @llvm.donothing() to label %normal unwind label %exception
711 %cleanup = landingpad i32 cleanup
717 ;; Atomic Memory Ordering Constraints
718 define void @atomics(i32* %word) {
719 %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
720 ; CHECK: %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
721 %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
722 ; CHECK: %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
723 %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
724 ; CHECK: %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
725 %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
726 ; CHECK: %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
727 %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
728 ; CHECK: %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
729 %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
730 ; CHECK: %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
731 %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
732 ; CHECK: %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
733 %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
734 ; CHECK: %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
735 %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
736 ; CHECK: %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
737 %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic
738 ; CHECK: %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic
739 %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic
740 ; CHECK: %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic
741 %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic
742 ; CHECK: %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic
743 %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic
744 ; CHECK: %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic
745 %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic
746 ; CHECK: %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic
747 %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic
748 ; CHECK: %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic
749 %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic
750 ; CHECK: %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic
751 %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic
752 ; CHECK: %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic
753 %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic
754 ; CHECK: %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic
755 %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic
756 ; CHECK: %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic
758 ; CHECK: fence acquire
760 ; CHECK: fence release
762 ; CHECK: fence acq_rel
763 fence syncscope("singlethread") seq_cst
764 ; CHECK: fence syncscope("singlethread") seq_cst
766 %ld.1 = load atomic i32, i32* %word monotonic, align 4
767 ; CHECK: %ld.1 = load atomic i32, i32* %word monotonic, align 4
768 %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
769 ; CHECK: %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
770 %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16
771 ; CHECK: %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16
773 store atomic i32 23, i32* %word monotonic, align 4
774 ; CHECK: store atomic i32 23, i32* %word monotonic, align 4
775 store atomic volatile i32 24, i32* %word monotonic, align 4
776 ; CHECK: store atomic volatile i32 24, i32* %word monotonic, align 4
777 store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4
778 ; CHECK: store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4
782 define void @fp_atomics(float* %word) {
783 ; CHECK: %atomicrmw.xchg = atomicrmw xchg float* %word, float 1.000000e+00 monotonic
784 %atomicrmw.xchg = atomicrmw xchg float* %word, float 1.0 monotonic
786 ; CHECK: %atomicrmw.fadd = atomicrmw fadd float* %word, float 1.000000e+00 monotonic
787 %atomicrmw.fadd = atomicrmw fadd float* %word, float 1.0 monotonic
789 ; CHECK: %atomicrmw.fsub = atomicrmw fsub float* %word, float 1.000000e+00 monotonic
790 %atomicrmw.fsub = atomicrmw fsub float* %word, float 1.0 monotonic
796 define void @fastmathflags_unop(float %op1) {
797 %f.nnan = fneg nnan float %op1
798 ; CHECK: %f.nnan = fneg nnan float %op1
799 %f.ninf = fneg ninf float %op1
800 ; CHECK: %f.ninf = fneg ninf float %op1
801 %f.nsz = fneg nsz float %op1
802 ; CHECK: %f.nsz = fneg nsz float %op1
803 %f.arcp = fneg arcp float %op1
804 ; CHECK: %f.arcp = fneg arcp float %op1
805 %f.contract = fneg contract float %op1
806 ; CHECK: %f.contract = fneg contract float %op1
807 %f.afn = fneg afn float %op1
808 ; CHECK: %f.afn = fneg afn float %op1
809 %f.reassoc = fneg reassoc float %op1
810 ; CHECK: %f.reassoc = fneg reassoc float %op1
811 %f.fast = fneg fast float %op1
812 ; CHECK: %f.fast = fneg fast float %op1
816 define void @fastmathflags_binops(float %op1, float %op2) {
817 %f.nnan = fadd nnan float %op1, %op2
818 ; CHECK: %f.nnan = fadd nnan float %op1, %op2
819 %f.ninf = fadd ninf float %op1, %op2
820 ; CHECK: %f.ninf = fadd ninf float %op1, %op2
821 %f.nsz = fadd nsz float %op1, %op2
822 ; CHECK: %f.nsz = fadd nsz float %op1, %op2
823 %f.arcp = fadd arcp float %op1, %op2
824 ; CHECK: %f.arcp = fadd arcp float %op1, %op2
825 %f.contract = fadd contract float %op1, %op2
826 ; CHECK: %f.contract = fadd contract float %op1, %op2
827 %f.afn = fadd afn float %op1, %op2
828 ; CHECK: %f.afn = fadd afn float %op1, %op2
829 %f.reassoc = fadd reassoc float %op1, %op2
830 ; CHECK: %f.reassoc = fadd reassoc float %op1, %op2
831 %f.fast = fadd fast float %op1, %op2
832 ; CHECK: %f.fast = fadd fast float %op1, %op2
836 define void @fastmathflags_select(i1 %cond, float %op1, float %op2) {
837 %f.nnan = select nnan i1 %cond, float %op1, float %op2
838 ; CHECK: %f.nnan = select nnan i1 %cond, float %op1, float %op2
839 %f.ninf = select ninf i1 %cond, float %op1, float %op2
840 ; CHECK: %f.ninf = select ninf i1 %cond, float %op1, float %op2
841 %f.nsz = select nsz i1 %cond, float %op1, float %op2
842 ; CHECK: %f.nsz = select nsz i1 %cond, float %op1, float %op2
843 %f.arcp = select arcp i1 %cond, float %op1, float %op2
844 ; CHECK: %f.arcp = select arcp i1 %cond, float %op1, float %op2
845 %f.contract = select contract i1 %cond, float %op1, float %op2
846 ; CHECK: %f.contract = select contract i1 %cond, float %op1, float %op2
847 %f.afn = select afn i1 %cond, float %op1, float %op2
848 ; CHECK: %f.afn = select afn i1 %cond, float %op1, float %op2
849 %f.reassoc = select reassoc i1 %cond, float %op1, float %op2
850 ; CHECK: %f.reassoc = select reassoc i1 %cond, float %op1, float %op2
851 %f.fast = select fast i1 %cond, float %op1, float %op2
852 ; CHECK: %f.fast = select fast i1 %cond, float %op1, float %op2
856 define void @fastmathflags_vector_select(<2 x i1> %cond, <2 x double> %op1, <2 x double> %op2) {
857 %f.nnan.nsz = select nnan nsz <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
858 ; CHECK: %f.nnan.nsz = select nnan nsz <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
859 %f.fast = select fast <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
860 ; CHECK: %f.fast = select fast <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
864 ; Check various fast math flags and floating-point types on calls.
866 declare float @fmf1()
867 declare double @fmf2()
868 declare <4 x double> @fmf3()
870 ; CHECK-LABEL: fastMathFlagsForCalls(
871 define void @fastMathFlagsForCalls(float %f, double %d1, <4 x double> %d2) {
872 %call.fast = call fast float @fmf1()
873 ; CHECK: %call.fast = call fast float @fmf1()
875 ; Throw in some other attributes to make sure those stay in the right places.
877 %call.nsz.arcp = notail call nsz arcp double @fmf2()
878 ; CHECK: %call.nsz.arcp = notail call nsz arcp double @fmf2()
880 %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
881 ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
887 %opaquety = type opaque
888 define void @typesystem() {
889 %p0 = bitcast i8* null to i32 (i32)*
890 ; CHECK: %p0 = bitcast i8* null to i32 (i32)*
891 %p1 = bitcast i8* null to void (i8*)*
892 ; CHECK: %p1 = bitcast i8* null to void (i8*)*
893 %p2 = bitcast i8* null to i32 (i8*, ...)*
894 ; CHECK: %p2 = bitcast i8* null to i32 (i8*, ...)*
895 %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
896 ; CHECK: %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
897 %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
898 ; CHECK: %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
899 %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
900 ; CHECK: %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
902 %t0 = alloca i1942652
903 ; CHECK: %t0 = alloca i1942652
905 ; CHECK: %t1 = alloca half
907 ; CHECK: %t2 = alloca float
909 ; CHECK: %t3 = alloca double
911 ; CHECK: %t4 = alloca fp128
912 %t5 = alloca x86_fp80
913 ; CHECK: %t5 = alloca x86_fp80
914 %t6 = alloca ppc_fp128
915 ; CHECK: %t6 = alloca ppc_fp128
917 ; CHECK: %t7 = alloca x86_mmx
918 %t8 = alloca %opaquety*
919 ; CHECK: %t8 = alloca %opaquety*
920 %t9 = alloca <4 x i32>
921 ; CHECK: %t9 = alloca <4 x i32>
922 %t10 = alloca <vscale x 4 x i32>
923 ; CHECK: %t10 = alloca <vscale x 4 x i32>
928 declare void @llvm.token(token)
929 ; CHECK: declare void @llvm.token(token)
931 ;; Inline Assembler Expressions
932 define void @inlineasm(i32 %arg) {
933 call i32 asm "bswap $0", "=r,r"(i32 %arg)
934 ; CHECK: call i32 asm "bswap $0", "=r,r"(i32 %arg)
935 call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
936 ; CHECK: call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
942 ; Instructions -- Terminators
943 define void @instructions.terminators(i8 %val) personality i32 -10 {
944 br i1 false, label %iftrue, label %iffalse
945 ; CHECK: br i1 false, label %iftrue, label %iffalse
947 ; CHECK: br label %iftrue
953 switch i8 %val, label %defaultdest [
954 ; CHECK: switch i8 %val, label %defaultdest [
955 i8 0, label %defaultdest.0
956 ; CHECK: i8 0, label %defaultdest.0
957 i8 1, label %defaultdest.1
958 ; CHECK: i8 1, label %defaultdest.1
959 i8 2, label %defaultdest.2
960 ; CHECK: i8 2, label %defaultdest.2
971 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
972 ; CHECK: indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
973 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
974 ; CHECK: indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
976 invoke fastcc void @f.fastcc()
977 ; CHECK: invoke fastcc void @f.fastcc()
978 to label %defaultdest unwind label %exc
979 ; CHECK: to label %defaultdest unwind label %exc
981 %cleanup = landingpad i32 cleanup
984 ; CHECK: resume i32 undef
991 define i32 @instructions.win_eh.1() personality i32 -3 {
995 invoke void @f.ccc() to label %normal unwind label %catchswitch1
996 invoke void @f.ccc() to label %normal unwind label %catchswitch2
997 invoke void @f.ccc() to label %normal unwind label %catchswitch3
1000 %cs1 = catchswitch within none [label %catchpad1] unwind to caller
1003 catchpad within %cs1 []
1005 ; CHECK: catchpad within %cs1 []
1006 ; CHECK-NEXT: br label %normal
1009 %cs2 = catchswitch within none [label %catchpad2] unwind to caller
1012 catchpad within %cs2 [i32* %arg1]
1014 ; CHECK: catchpad within %cs2 [i32* %arg1]
1015 ; CHECK-NEXT: br label %normal
1018 %cs3 = catchswitch within none [label %catchpad3] unwind label %cleanuppad1
1021 catchpad within %cs3 [i32* %arg1, i32* %arg2]
1023 ; CHECK: catchpad within %cs3 [i32* %arg1, i32* %arg2]
1024 ; CHECK-NEXT: br label %normal
1027 %clean.1 = cleanuppad within none []
1029 ; CHECK: %clean.1 = cleanuppad within none []
1030 ; CHECK-NEXT: unreachable
1036 define i32 @instructions.win_eh.2() personality i32 -4 {
1038 invoke void @f.ccc() to label %invoke.cont unwind label %catchswitch
1041 invoke void @f.ccc() to label %continue unwind label %cleanup
1044 %clean = cleanuppad within none []
1045 ; CHECK: %clean = cleanuppad within none []
1046 cleanupret from %clean unwind to caller
1047 ; CHECK: cleanupret from %clean unwind to caller
1050 %cs = catchswitch within none [label %catchpad] unwind label %terminate
1053 %catch = catchpad within %cs []
1055 ; CHECK: %catch = catchpad within %cs []
1056 ; CHECK-NEXT: br label %body
1059 invoke void @f.ccc() [ "funclet"(token %catch) ]
1060 to label %continue unwind label %terminate.inner
1061 catchret from %catch to label %return
1062 ; CHECK: catchret from %catch to label %return
1068 cleanuppad within %catch []
1070 ; CHECK: cleanuppad within %catch []
1071 ; CHECK-NEXT: unreachable
1074 cleanuppad within none []
1076 ; CHECK: cleanuppad within none []
1077 ; CHECK-NEXT: unreachable
1083 ; Instructions -- Unary Operations
1084 define void @instructions.unops(double %op1) {
1086 ; CHECK: fneg double %op1
1090 ; Instructions -- Binary Operations
1091 define void @instructions.binops(i8 %op1, i8 %op2) {
1094 ; CHECK: add i8 %op1, %op2
1095 add nuw i8 %op1, %op2
1096 ; CHECK: add nuw i8 %op1, %op2
1097 add nsw i8 %op1, %op2
1098 ; CHECK: add nsw i8 %op1, %op2
1099 add nuw nsw i8 %op1, %op2
1100 ; CHECK: add nuw nsw i8 %op1, %op2
1102 ; CHECK: sub i8 %op1, %op2
1103 sub nuw i8 %op1, %op2
1104 ; CHECK: sub nuw i8 %op1, %op2
1105 sub nsw i8 %op1, %op2
1106 ; CHECK: sub nsw i8 %op1, %op2
1107 sub nuw nsw i8 %op1, %op2
1108 ; CHECK: sub nuw nsw i8 %op1, %op2
1110 ; CHECK: mul i8 %op1, %op2
1111 mul nuw i8 %op1, %op2
1112 ; CHECK: mul nuw i8 %op1, %op2
1113 mul nsw i8 %op1, %op2
1114 ; CHECK: mul nsw i8 %op1, %op2
1115 mul nuw nsw i8 %op1, %op2
1116 ; CHECK: mul nuw nsw i8 %op1, %op2
1120 ; CHECK: udiv i8 %op1, %op2
1121 udiv exact i8 %op1, %op2
1122 ; CHECK: udiv exact i8 %op1, %op2
1124 ; CHECK: sdiv i8 %op1, %op2
1125 sdiv exact i8 %op1, %op2
1126 ; CHECK: sdiv exact i8 %op1, %op2
1130 ; CHECK: urem i8 %op1, %op2
1132 ; CHECK: srem i8 %op1, %op2
1137 ; Instructions -- Bitwise Binary Operations
1138 define void @instructions.bitwise_binops(i8 %op1, i8 %op2) {
1141 ; CHECK: shl i8 %op1, %op2
1142 shl nuw i8 %op1, %op2
1143 ; CHECK: shl nuw i8 %op1, %op2
1144 shl nsw i8 %op1, %op2
1145 ; CHECK: shl nsw i8 %op1, %op2
1146 shl nuw nsw i8 %op1, %op2
1147 ; CHECK: shl nuw nsw i8 %op1, %op2
1151 ; CHECK: lshr i8 %op1, %op2
1152 lshr exact i8 %op1, %op2
1153 ; CHECK: lshr exact i8 %op1, %op2
1155 ; CHECK: ashr i8 %op1, %op2
1156 ashr exact i8 %op1, %op2
1157 ; CHECK: ashr exact i8 %op1, %op2
1161 ; CHECK: and i8 %op1, %op2
1163 ; CHECK: or i8 %op1, %op2
1165 ; CHECK: xor i8 %op1, %op2
1170 ; Instructions -- Vector Operations
1171 define void @instructions.vectorops(<4 x float> %vec, <4 x float> %vec2) {
1172 extractelement <4 x float> %vec, i8 0
1173 ; CHECK: extractelement <4 x float> %vec, i8 0
1174 insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1175 ; CHECK: insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1176 shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1177 ; CHECK: shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1182 ; Instructions -- Aggregate Operations
1183 define void @instructions.aggregateops({ i8, i32 } %up, <{ i8, i32 }> %p,
1184 [3 x i8] %arr, { i8, { i32 }} %n,
1185 <2 x i8*> %pvec, <2 x i64> %offsets) {
1186 extractvalue { i8, i32 } %up, 0
1187 ; CHECK: extractvalue { i8, i32 } %up, 0
1188 extractvalue <{ i8, i32 }> %p, 1
1189 ; CHECK: extractvalue <{ i8, i32 }> %p, 1
1190 extractvalue [3 x i8] %arr, 2
1191 ; CHECK: extractvalue [3 x i8] %arr, 2
1192 extractvalue { i8, { i32 } } %n, 1, 0
1193 ; CHECK: extractvalue { i8, { i32 } } %n, 1, 0
1195 insertvalue { i8, i32 } %up, i8 1, 0
1196 ; CHECK: insertvalue { i8, i32 } %up, i8 1, 0
1197 insertvalue <{ i8, i32 }> %p, i32 2, 1
1198 ; CHECK: insertvalue <{ i8, i32 }> %p, i32 2, 1
1199 insertvalue [3 x i8] %arr, i8 0, 0
1200 ; CHECK: insertvalue [3 x i8] %arr, i8 0, 0
1201 insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1202 ; CHECK: insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1204 %up.ptr = alloca { i8, i32 }
1205 %p.ptr = alloca <{ i8, i32 }>
1206 %arr.ptr = alloca [3 x i8]
1207 %n.ptr = alloca { i8, { i32 } }
1209 getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
1210 ; CHECK: getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
1211 getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
1212 ; CHECK: getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
1213 getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
1214 ; CHECK: getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
1215 getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
1216 ; CHECK: getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
1217 getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
1218 ; CHECK: getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
1219 getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
1220 ; CHECK: getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
1225 ; Instructions -- Memory Access and Addressing Operations
1229 define void @instructions.memops(i32** %base) {
1230 alloca i32, i8 4, align 4
1231 ; CHECK: alloca i32, i8 4, align 4
1232 alloca inalloca i32, i8 4, align 4
1233 ; CHECK: alloca inalloca i32, i8 4, align 4
1235 load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1236 ; CHECK: load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1237 load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1238 ; CHECK: load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1240 store i32* null, i32** %base, align 4, !nontemporal !8
1241 ; CHECK: store i32* null, i32** %base, align 4, !nontemporal !8
1242 store volatile i32* null, i32** %base, align 4, !nontemporal !8
1243 ; CHECK: store volatile i32* null, i32** %base, align 4, !nontemporal !8
1248 ; Instructions -- Conversion Operations
1249 define void @instructions.conversions() {
1251 ; CHECK: trunc i32 -1 to i1
1253 ; CHECK: zext i32 -1 to i64
1255 ; CHECK: sext i32 -1 to i64
1256 fptrunc float undef to half
1257 ; CHECK: fptrunc float undef to half
1258 fpext half undef to float
1259 ; CHECK: fpext half undef to float
1260 fptoui float undef to i32
1261 ; CHECK: fptoui float undef to i32
1262 fptosi float undef to i32
1263 ; CHECK: fptosi float undef to i32
1264 uitofp i32 1 to float
1265 ; CHECK: uitofp i32 1 to float
1266 sitofp i32 -1 to float
1267 ; CHECK: sitofp i32 -1 to float
1268 ptrtoint i8* null to i64
1269 ; CHECK: ptrtoint i8* null to i64
1270 inttoptr i64 0 to i8*
1271 ; CHECK: inttoptr i64 0 to i8*
1272 bitcast i32 0 to i32
1273 ; CHECK: bitcast i32 0 to i32
1274 addrspacecast i32* null to i32 addrspace(1)*
1275 ; CHECK: addrspacecast i32* null to i32 addrspace(1)*
1280 ; Instructions -- Other Operations
1281 define void @instructions.other(i32 %op1, i32 %op2, half %fop1, half %fop2) {
1283 icmp eq i32 %op1, %op2
1284 ; CHECK: icmp eq i32 %op1, %op2
1285 icmp ne i32 %op1, %op2
1286 ; CHECK: icmp ne i32 %op1, %op2
1287 icmp ugt i32 %op1, %op2
1288 ; CHECK: icmp ugt i32 %op1, %op2
1289 icmp uge i32 %op1, %op2
1290 ; CHECK: icmp uge i32 %op1, %op2
1291 icmp ult i32 %op1, %op2
1292 ; CHECK: icmp ult i32 %op1, %op2
1293 icmp ule i32 %op1, %op2
1294 ; CHECK: icmp ule i32 %op1, %op2
1295 icmp sgt i32 %op1, %op2
1296 ; CHECK: icmp sgt i32 %op1, %op2
1297 icmp sge i32 %op1, %op2
1298 ; CHECK: icmp sge i32 %op1, %op2
1299 icmp slt i32 %op1, %op2
1300 ; CHECK: icmp slt i32 %op1, %op2
1301 icmp sle i32 %op1, %op2
1302 ; CHECK: icmp sle i32 %op1, %op2
1304 fcmp false half %fop1, %fop2
1305 ; CHECK: fcmp false half %fop1, %fop2
1306 fcmp oeq half %fop1, %fop2
1307 ; CHECK: fcmp oeq half %fop1, %fop2
1308 fcmp ogt half %fop1, %fop2
1309 ; CHECK: fcmp ogt half %fop1, %fop2
1310 fcmp oge half %fop1, %fop2
1311 ; CHECK: fcmp oge half %fop1, %fop2
1312 fcmp olt half %fop1, %fop2
1313 ; CHECK: fcmp olt half %fop1, %fop2
1314 fcmp ole half %fop1, %fop2
1315 ; CHECK: fcmp ole half %fop1, %fop2
1316 fcmp one half %fop1, %fop2
1317 ; CHECK: fcmp one half %fop1, %fop2
1318 fcmp ord half %fop1, %fop2
1319 ; CHECK: fcmp ord half %fop1, %fop2
1320 fcmp ueq half %fop1, %fop2
1321 ; CHECK: fcmp ueq half %fop1, %fop2
1322 fcmp ugt half %fop1, %fop2
1323 ; CHECK: fcmp ugt half %fop1, %fop2
1324 fcmp uge half %fop1, %fop2
1325 ; CHECK: fcmp uge half %fop1, %fop2
1326 fcmp ult half %fop1, %fop2
1327 ; CHECK: fcmp ult half %fop1, %fop2
1328 fcmp ule half %fop1, %fop2
1329 ; CHECK: fcmp ule half %fop1, %fop2
1330 fcmp une half %fop1, %fop2
1331 ; CHECK: fcmp une half %fop1, %fop2
1332 fcmp uno half %fop1, %fop2
1333 ; CHECK: fcmp uno half %fop1, %fop2
1334 fcmp true half %fop1, %fop2
1335 ; CHECK: fcmp true half %fop1, %fop2
1339 %v1 = add i32 %op1, %op2
1342 %v2 = add i32 %op1, %op2
1345 phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1346 ; CHECK: phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1348 select i1 true, i32 0, i32 1
1349 ; CHECK: select i1 true, i32 0, i32 1
1350 select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1351 ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1353 call void @f.nobuiltin() builtin
1354 ; CHECK: call void @f.nobuiltin() #43
1356 call void @f.strictfp() strictfp
1357 ; CHECK: call void @f.strictfp() #44
1359 call fastcc noalias i32* @f.noalias() noinline
1360 ; CHECK: call fastcc noalias i32* @f.noalias() #12
1361 tail call ghccc nonnull i32* @f.nonnull() minsize
1362 ; CHECK: tail call ghccc nonnull i32* @f.nonnull() #7
1367 define void @instructions.call_musttail(i8* inalloca %val) {
1368 musttail call void @f.param.inalloca(i8* inalloca %val)
1369 ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val)
1374 define void @instructions.call_notail() {
1375 notail call void @f1()
1376 ; CHECK: notail call void @f1()
1381 define void @instructions.landingpad() personality i32 -2 {
1382 invoke void @llvm.donothing() to label %proceed unwind label %catch1
1383 invoke void @llvm.donothing() to label %proceed unwind label %catch2
1384 invoke void @llvm.donothing() to label %proceed unwind label %catch3
1385 invoke void @llvm.donothing() to label %proceed unwind label %catch4
1389 ; CHECK: landingpad i32
1396 ; CHECK: landingpad i32
1400 ; CHECK: catch i32* null
1405 ; CHECK: landingpad i32
1409 ; CHECK: catch i32* null
1411 ; CHECK: catch i32* null
1416 ; CHECK: landingpad i32
1417 filter [2 x i32] zeroinitializer
1418 ; CHECK: filter [2 x i32] zeroinitializer
1425 ;; Intrinsic Functions
1427 ; Intrinsic Functions -- Variable Argument Handling
1428 declare void @llvm.va_start(i8*)
1429 declare void @llvm.va_copy(i8*, i8*)
1430 declare void @llvm.va_end(i8*)
1431 define void @instructions.va_arg(i8* %v, ...) {
1433 %ap2 = bitcast i8** %ap to i8*
1435 call void @llvm.va_start(i8* %ap2)
1436 ; CHECK: call void @llvm.va_start(i8* %ap2)
1438 va_arg i8* %ap2, i32
1439 ; CHECK: va_arg i8* %ap2, i32
1441 call void @llvm.va_copy(i8* %v, i8* %ap2)
1442 ; CHECK: call void @llvm.va_copy(i8* %v, i8* %ap2)
1444 call void @llvm.va_end(i8* %ap2)
1445 ; CHECK: call void @llvm.va_end(i8* %ap2)
1450 ; Intrinsic Functions -- Accurate Garbage Collection
1451 declare void @llvm.gcroot(i8**, i8*)
1452 declare i8* @llvm.gcread(i8*, i8**)
1453 declare void @llvm.gcwrite(i8*, i8*, i8**)
1454 define void @intrinsics.gc() gc "shadow-stack" {
1455 %ptrloc = alloca i8*
1456 call void @llvm.gcroot(i8** %ptrloc, i8* null)
1457 ; CHECK: call void @llvm.gcroot(i8** %ptrloc, i8* null)
1459 call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1460 ; CHECK: call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1463 call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1464 ; CHECK: call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1469 ; Intrinsic Functions -- Code Generation
1470 declare i8* @llvm.returnaddress(i32)
1471 declare i8* @llvm.frameaddress(i32)
1472 declare i32 @llvm.read_register.i32(metadata)
1473 declare i64 @llvm.read_register.i64(metadata)
1474 declare void @llvm.write_register.i32(metadata, i32)
1475 declare void @llvm.write_register.i64(metadata, i64)
1476 declare i8* @llvm.stacksave()
1477 declare void @llvm.stackrestore(i8*)
1478 declare void @llvm.prefetch.p0i8(i8*, i32, i32, i32)
1479 declare void @llvm.pcmarker(i32)
1480 declare i64 @llvm.readcyclecounter()
1481 declare void @llvm.clear_cache(i8*, i8*)
1482 declare void @llvm.instrprof_increment(i8*, i64, i32, i32)
1485 define void @intrinsics.codegen() {
1486 call i8* @llvm.returnaddress(i32 1)
1487 ; CHECK: call i8* @llvm.returnaddress(i32 1)
1488 call i8* @llvm.frameaddress(i32 1)
1489 ; CHECK: call i8* @llvm.frameaddress.p0i8(i32 1)
1491 call i32 @llvm.read_register.i32(metadata !10)
1492 ; CHECK: call i32 @llvm.read_register.i32(metadata !10)
1493 call i64 @llvm.read_register.i64(metadata !10)
1494 ; CHECK: call i64 @llvm.read_register.i64(metadata !10)
1495 call void @llvm.write_register.i32(metadata !10, i32 0)
1496 ; CHECK: call void @llvm.write_register.i32(metadata !10, i32 0)
1497 call void @llvm.write_register.i64(metadata !10, i64 0)
1498 ; CHECK: call void @llvm.write_register.i64(metadata !10, i64 0)
1500 %stack = call i8* @llvm.stacksave()
1501 ; CHECK: %stack = call i8* @llvm.stacksave()
1502 call void @llvm.stackrestore(i8* %stack)
1503 ; CHECK: call void @llvm.stackrestore(i8* %stack)
1505 call void @llvm.prefetch.p0i8(i8* %stack, i32 0, i32 3, i32 0)
1506 ; CHECK: call void @llvm.prefetch.p0i8(i8* %stack, i32 0, i32 3, i32 0)
1508 call void @llvm.pcmarker(i32 1)
1509 ; CHECK: call void @llvm.pcmarker(i32 1)
1511 call i64 @llvm.readcyclecounter()
1512 ; CHECK: call i64 @llvm.readcyclecounter()
1514 call void @llvm.clear_cache(i8* null, i8* null)
1515 ; CHECK: call void @llvm.clear_cache(i8* null, i8* null)
1517 call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1518 ; CHECK: call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1523 declare void @llvm.localescape(...)
1524 declare i8* @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
1525 define void @intrinsics.localescape() {
1526 %static.alloca = alloca i32
1527 call void (...) @llvm.localescape(i32* %static.alloca)
1528 ; CHECK: call void (...) @llvm.localescape(i32* %static.alloca)
1530 call void @intrinsics.localrecover()
1534 define void @intrinsics.localrecover() {
1535 %func = bitcast void ()* @intrinsics.localescape to i8*
1536 %fp = call i8* @llvm.frameaddress(i32 1)
1537 call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1538 ; CHECK: call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1543 ; We need this function to provide `uses' for some metadata tests.
1544 define void @misc.metadata() {
1545 call void @f1(), !srcloc !11
1546 call void @f1(), !srcloc !12
1547 call void @f1(), !srcloc !13
1548 call void @f1(), !srcloc !14
1552 declare void @op_bundle_callee_0()
1553 declare void @op_bundle_callee_1(i32,i32)
1555 define void @call_with_operand_bundle0(i32* %ptr) {
1556 ; CHECK-LABEL: call_with_operand_bundle0(
1558 %l = load i32, i32* %ptr
1560 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1561 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1565 define void @call_with_operand_bundle1(i32* %ptr) {
1566 ; CHECK-LABEL: call_with_operand_bundle1(
1568 %l = load i32, i32* %ptr
1571 call void @op_bundle_callee_0()
1572 call void @op_bundle_callee_0() [ "foo"() ]
1573 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1574 ; CHECK: @op_bundle_callee_0(){{$}}
1575 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"() ]
1576 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1580 define void @call_with_operand_bundle2(i32* %ptr) {
1581 ; CHECK-LABEL: call_with_operand_bundle2(
1583 call void @op_bundle_callee_0() [ "foo"() ]
1584 ; CHECK: call void @op_bundle_callee_0() [ "foo"() ]
1588 define void @call_with_operand_bundle3(i32* %ptr) {
1589 ; CHECK-LABEL: call_with_operand_bundle3(
1591 %l = load i32, i32* %ptr
1593 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1594 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1598 define void @call_with_operand_bundle4(i32* %ptr) {
1599 ; CHECK-LABEL: call_with_operand_bundle4(
1601 %l = load i32, i32* %ptr
1603 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) ]
1604 ; 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) ]
1608 ; Invoke versions of the above tests:
1611 define void @invoke_with_operand_bundle0(i32* %ptr) personality i8 3 {
1612 ; CHECK-LABEL: @invoke_with_operand_bundle0(
1614 %l = load i32, i32* %ptr
1616 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
1617 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1620 %cleanup = landingpad i8 cleanup
1626 define void @invoke_with_operand_bundle1(i32* %ptr) personality i8 3 {
1627 ; CHECK-LABEL: @invoke_with_operand_bundle1(
1629 %l = load i32, i32* %ptr
1632 invoke void @op_bundle_callee_0() to label %normal unwind label %exception
1633 ; CHECK: invoke void @op_bundle_callee_0(){{$}}
1636 %cleanup = landingpad i8 cleanup
1640 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal1 unwind label %exception1
1641 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1644 %cleanup1 = landingpad i8 cleanup
1648 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
1649 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1652 %cleanup2 = landingpad i8 cleanup
1659 define void @invoke_with_operand_bundle2(i32* %ptr) personality i8 3 {
1660 ; CHECK-LABEL: @invoke_with_operand_bundle2(
1662 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal unwind label %exception
1663 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1666 %cleanup = landingpad i8 cleanup
1672 define void @invoke_with_operand_bundle3(i32* %ptr) personality i8 3 {
1673 ; CHECK-LABEL: @invoke_with_operand_bundle3(
1675 %l = load i32, i32* %ptr
1677 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
1678 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1681 %cleanup = landingpad i8 cleanup
1687 define void @invoke_with_operand_bundle4(i32* %ptr) personality i8 3 {
1688 ; CHECK-LABEL: @invoke_with_operand_bundle4(
1690 %l = load i32, i32* %ptr
1692 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) ]
1693 to label %normal unwind label %exception
1694 ; 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) ]
1697 %cleanup = landingpad i8 cleanup
1703 declare void @vaargs_func(...)
1704 define void @invoke_with_operand_bundle_vaarg(i32* %ptr) personality i8 3 {
1705 ; CHECK-LABEL: @invoke_with_operand_bundle_vaarg(
1707 %l = load i32, i32* %ptr
1709 invoke void (...) @vaargs_func(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1710 to label %normal unwind label %exception
1711 ; 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) ]
1714 %cleanup = landingpad i8 cleanup
1721 declare void @f.writeonly() writeonly
1722 ; CHECK: declare void @f.writeonly() #41
1724 declare void @f.speculatable() speculatable
1725 ; CHECK: declare void @f.speculatable() #42
1727 ;; Constant Expressions
1729 define i8** @constexpr() {
1730 ; 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)
1731 ret i8** getelementptr inbounds ({ [4 x i8*], [4 x i8*] }, { [4 x i8*], [4 x i8*] }* null, i32 0, inrange i32 1, i32 2)
1735 declare void @llvm.test.immarg.intrinsic(i32 immarg)
1736 ; CHECK: declare void @llvm.test.immarg.intrinsic(i32 immarg)
1738 ; byval attribute with type
1739 %named_type = type [8 x i8]
1740 declare void @byval_type(i32* byval(i32) align 2)
1741 declare void @byval_type2({ i8, i8* }* byval({ i8, i8* }))
1742 declare void @byval_named_type(%named_type* byval(%named_type))
1743 ; CHECK: declare void @byval_type(i32* byval(i32) align 2)
1744 ; CHECK: declare void @byval_type2({ i8, i8* }* byval({ i8, i8* }))
1745 ; CHECK: declare void @byval_named_type([8 x i8]* byval([8 x i8]))
1747 ; CHECK: attributes #0 = { alignstack=4 }
1748 ; CHECK: attributes #1 = { alignstack=8 }
1749 ; CHECK: attributes #2 = { alwaysinline }
1750 ; CHECK: attributes #3 = { cold }
1751 ; CHECK: attributes #4 = { convergent }
1752 ; CHECK: attributes #5 = { inlinehint }
1753 ; CHECK: attributes #6 = { jumptable }
1754 ; CHECK: attributes #7 = { minsize }
1755 ; CHECK: attributes #8 = { naked }
1756 ; CHECK: attributes #9 = { nobuiltin }
1757 ; CHECK: attributes #10 = { noduplicate }
1758 ; CHECK: attributes #11 = { noimplicitfloat }
1759 ; CHECK: attributes #12 = { noinline }
1760 ; CHECK: attributes #13 = { nonlazybind }
1761 ; CHECK: attributes #14 = { noredzone }
1762 ; CHECK: attributes #15 = { noreturn }
1763 ; CHECK: attributes #16 = { nounwind }
1764 ; CHECK: attributes #17 = { noinline optnone }
1765 ; CHECK: attributes #18 = { optsize }
1766 ; CHECK: attributes #19 = { readnone }
1767 ; CHECK: attributes #20 = { readonly }
1768 ; CHECK: attributes #21 = { returns_twice }
1769 ; CHECK: attributes #22 = { safestack }
1770 ; CHECK: attributes #23 = { sanitize_address }
1771 ; CHECK: attributes #24 = { sanitize_memory }
1772 ; CHECK: attributes #25 = { sanitize_thread }
1773 ; CHECK: attributes #26 = { ssp }
1774 ; CHECK: attributes #27 = { sspreq }
1775 ; CHECK: attributes #28 = { sspstrong }
1776 ; CHECK: attributes #29 = { "thunk" }
1777 ; CHECK: attributes #30 = { uwtable }
1778 ; CHECK: attributes #31 = { "cpu"="cortex-a8" }
1779 ; CHECK: attributes #32 = { norecurse }
1780 ; CHECK: attributes #33 = { inaccessiblememonly }
1781 ; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly }
1782 ; CHECK: attributes #35 = { nounwind readnone willreturn }
1783 ; CHECK: attributes #36 = { argmemonly nounwind readonly }
1784 ; CHECK: attributes #37 = { argmemonly nounwind }
1785 ; CHECK: attributes #38 = { nounwind readnone }
1786 ; CHECK: attributes #39 = { nounwind readonly }
1787 ; CHECK: attributes #40 = { inaccessiblemem_or_argmemonly nounwind willreturn }
1788 ; CHECK: attributes #41 = { writeonly }
1789 ; CHECK: attributes #42 = { speculatable }
1790 ; CHECK: attributes #43 = { builtin }
1791 ; CHECK: attributes #44 = { strictfp }
1795 ; Metadata -- Module flags
1796 !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1797 ; CHECK: !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1799 !0 = !{i32 1, !"mod1", i32 0}
1800 ; CHECK: !0 = !{i32 1, !"mod1", i32 0}
1801 !1 = !{i32 2, !"mod2", i32 0}
1802 ; CHECK: !1 = !{i32 2, !"mod2", i32 0}
1803 !2 = !{i32 3, !"mod3", !3}
1804 ; CHECK: !2 = !{i32 3, !"mod3", !3}
1806 ; CHECK: !3 = !{!"mod6", !0}
1807 !4 = !{i32 4, !"mod4", i32 0}
1808 ; CHECK: !4 = !{i32 4, !"mod4", i32 0}
1809 !5 = !{i32 5, !"mod5", !0}
1810 ; CHECK: !5 = !{i32 5, !"mod5", !0}
1811 !6 = !{i32 6, !"mod6", !0}
1812 ; CHECK: !6 = !{i32 6, !"mod6", !0}
1814 ; Metadata -- Check `distinct'
1816 ; CHECK: !11 = distinct !{}
1818 ; CHECK: !12 = distinct !{}
1820 ; CHECK: !13 = !{!11}
1822 ; CHECK: !14 = !{!12}