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: 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 nodeduplicate
29 ; CHECK: $comdat.noduplicates = comdat nodeduplicate
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 ptr null
43 ; CHECK: @const.null = constant ptr null
44 %const.struct.type = type { i32, i8, i64 }
45 %const.struct.type.packed = type <{ i32, i8 }>
46 @const.struct = constant %const.struct.type { i32 -1, i8 undef, i64 poison }
47 ; CHECK: @const.struct = constant %const.struct.type { i32 -1, i8 undef, i64 poison }
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, ptr, ptr }
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 ptr] [ptr @g.used1], section "llvm.metadata"
198 ; CHECK: @llvm.used = appending global [1 x ptr] [ptr @g.used1], section "llvm.metadata"
199 @llvm.compiler.used = appending global [1 x ptr] [ptr @g.used2], section "llvm.metadata"
200 ; CHECK: @llvm.compiler.used = appending global [1 x ptr] [ptr @g.used2], section "llvm.metadata"
201 @llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, ptr @g.f1, ptr @g.used3 }], section "llvm.metadata"
202 ; CHECK: @llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, ptr @g.f1, ptr @g.used3 }], section "llvm.metadata"
203 @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, ptr @g.f1, ptr @g.used3 }], section "llvm.metadata"
204 ; CHECK: @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, ptr @g.f1, ptr @g.used3 }], section "llvm.metadata"
206 ; Global Variables -- sanitizers
207 @g.no_sanitize_address = global i32 0, no_sanitize_address
208 @g.no_sanitize_hwaddress = global i32 0, no_sanitize_hwaddress
209 @g.sanitize_memtag = global i32 0, sanitize_memtag
210 @g.no_sanitize_multiple = global i32 0, no_sanitize_address, no_sanitize_hwaddress
211 @g.sanitize_address_dyninit = global i32 0, sanitize_address_dyninit
212 @g.sanitize_multiple = global i32 0, sanitize_memtag, sanitize_address_dyninit
213 ; CHECK: @g.no_sanitize_address = global i32 0, no_sanitize_address
214 ; CHECK: @g.no_sanitize_hwaddress = global i32 0, no_sanitize_hwaddress
215 ; CHECK: @g.sanitize_memtag = global i32 0, sanitize_memtag
216 ; CHECK: @g.no_sanitize_multiple = global i32 0, no_sanitize_address, no_sanitize_hwaddress
217 ; CHECK: @g.sanitize_address_dyninit = global i32 0, sanitize_address_dyninit
218 ; CHECK: @g.sanitize_multiple = global i32 0, sanitize_memtag, sanitize_address_dyninit
221 ; Format: @<Name> = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
222 ; [unnamed_addr] alias <AliaseeTy> @<Aliasee>
225 @a.private = private alias i32, ptr @g.private
226 ; CHECK: @a.private = private alias i32, ptr @g.private
227 @a.internal = internal alias i32, ptr @g.internal
228 ; CHECK: @a.internal = internal alias i32, ptr @g.internal
229 @a.linkonce = linkonce alias i32, ptr @g.linkonce
230 ; CHECK: @a.linkonce = linkonce alias i32, ptr @g.linkonce
231 @a.weak = weak alias i32, ptr @g.weak
232 ; CHECK: @a.weak = weak alias i32, ptr @g.weak
233 @a.linkonce_odr = linkonce_odr alias i32, ptr @g.linkonce_odr
234 ; CHECK: @a.linkonce_odr = linkonce_odr alias i32, ptr @g.linkonce_odr
235 @a.weak_odr = weak_odr alias i32, ptr @g.weak_odr
236 ; CHECK: @a.weak_odr = weak_odr alias i32, ptr @g.weak_odr
237 @a.external = external alias i32, ptr @g1
238 ; CHECK: @a.external = alias i32, ptr @g1
240 ; Aliases -- Visibility
241 @a.default = default alias i32, ptr @g.default
242 ; CHECK: @a.default = alias i32, ptr @g.default
243 @a.hidden = hidden alias i32, ptr @g.hidden
244 ; CHECK: @a.hidden = hidden alias i32, ptr @g.hidden
245 @a.protected = protected alias i32, ptr @g.protected
246 ; CHECK: @a.protected = protected alias i32, ptr @g.protected
248 ; Aliases -- DLLStorageClass
249 @a.dlldefault = default alias i32, ptr @g.dlldefault
250 ; CHECK: @a.dlldefault = alias i32, ptr @g.dlldefault
251 @a.dllexport = dllexport alias i32, ptr @g.dllexport
252 ; CHECK: @a.dllexport = dllexport alias i32, ptr @g.dllexport
254 ; Aliases -- ThreadLocal
255 @a.notthreadlocal = alias i32, ptr @g.notthreadlocal
256 ; CHECK: @a.notthreadlocal = alias i32, ptr @g.notthreadlocal
257 @a.generaldynamic = thread_local alias i32, ptr @g.generaldynamic
258 ; CHECK: @a.generaldynamic = thread_local alias i32, ptr @g.generaldynamic
259 @a.localdynamic = thread_local(localdynamic) alias i32, ptr @g.localdynamic
260 ; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, ptr @g.localdynamic
261 @a.initialexec = thread_local(initialexec) alias i32, ptr @g.initialexec
262 ; CHECK: @a.initialexec = thread_local(initialexec) alias i32, ptr @g.initialexec
263 @a.localexec = thread_local(localexec) alias i32, ptr @g.localexec
264 ; CHECK: @a.localexec = thread_local(localexec) alias i32, ptr @g.localexec
266 ; Aliases -- unnamed_addr and local_unnamed_addr
267 @a.unnamed_addr = unnamed_addr alias i32, ptr @g.unnamed_addr
268 ; CHECK: @a.unnamed_addr = unnamed_addr alias i32, ptr @g.unnamed_addr
269 @a.local_unnamed_addr = local_unnamed_addr alias i32, ptr @g.local_unnamed_addr
270 ; CHECK: @a.local_unnamed_addr = local_unnamed_addr alias i32, ptr @g.local_unnamed_addr
272 ; Aliases -- partition
273 ; CHECK: @alias.partition = alias i32, ptr @g.partition, partition "part"
274 @alias.partition = alias i32, ptr @g.partition, partition "part"
277 ; Format @<Name> = [Linkage] [Visibility] ifunc <IFuncTy>,
281 @ifunc.external = external ifunc void (), ptr @ifunc_resolver
282 ; CHECK: @ifunc.external = ifunc void (), ptr @ifunc_resolver
283 @ifunc.private = private ifunc void (), ptr @ifunc_resolver
284 ; CHECK: @ifunc.private = private ifunc void (), ptr @ifunc_resolver
285 @ifunc.internal = internal ifunc void (), ptr @ifunc_resolver
286 ; CHECK: @ifunc.internal = internal ifunc void (), ptr @ifunc_resolver
288 ; IFunc -- Visibility
289 @ifunc.default = default ifunc void (), ptr @ifunc_resolver
290 ; CHECK: @ifunc.default = ifunc void (), ptr @ifunc_resolver
291 @ifunc.hidden = hidden ifunc void (), ptr @ifunc_resolver
292 ; CHECK: @ifunc.hidden = hidden ifunc void (), ptr @ifunc_resolver
293 @ifunc.protected = protected ifunc void (), ptr @ifunc_resolver
294 ; CHECK: @ifunc.protected = protected ifunc void (), ptr @ifunc_resolver
297 ; CHECK: @ifunc.partition = ifunc void (), ptr @ifunc_resolver, partition "part"
298 @ifunc.partition = ifunc void (), ptr @ifunc_resolver, partition "part"
300 define ptr @ifunc_resolver() {
306 ; Format: define [linkage] [visibility] [DLLStorageClass]
307 ; [cconv] [ret attrs]
308 ; <ResultType> @<FunctionName> ([argument list])
309 ; [(unnamed_addr|local_unnamed_addr)] [fn Attrs] [section "name"] [comdat [($name)]]
310 ; [align N] [gc] [prefix Constant] [prologue Constant]
311 ; [personality Constant] { ... }
313 ; Functions -- Simple
315 ; CHECK: declare void @f1()
318 ; CHECK: define void @f2()
323 ; Functions -- linkage
324 define private void @f.private() {
325 ; CHECK: define private void @f.private()
329 define internal void @f.internal() {
330 ; CHECK: define internal void @f.internal()
334 define available_externally void @f.available_externally() {
335 ; CHECK: define available_externally void @f.available_externally()
339 define linkonce void @f.linkonce() {
340 ; CHECK: define linkonce void @f.linkonce()
344 define weak void @f.weak() {
345 ; CHECK: define weak void @f.weak()
349 define linkonce_odr void @f.linkonce_odr() {
350 ; CHECK: define linkonce_odr void @f.linkonce_odr()
354 define weak_odr void @f.weak_odr() {
355 ; CHECK: define weak_odr void @f.weak_odr()
359 declare external void @f.external()
360 ; CHECK: declare void @f.external()
361 declare extern_weak void @f.extern_weak()
362 ; CHECK: declare extern_weak void @f.extern_weak()
364 ; Functions -- visibility
365 declare default void @f.default()
366 ; CHECK: declare void @f.default()
367 declare hidden void @f.hidden()
368 ; CHECK: declare hidden void @f.hidden()
369 declare protected void @f.protected()
370 ; CHECK: declare protected void @f.protected()
372 ; Functions -- DLLStorageClass
373 declare dllimport void @f.dllimport()
374 ; CHECK: declare dllimport void @f.dllimport()
375 declare dllexport void @f.dllexport()
376 ; CHECK: declare dllexport void @f.dllexport()
378 ; Functions -- cconv (Calling conventions)
379 declare ccc void @f.ccc()
380 ; CHECK: declare void @f.ccc()
381 declare fastcc void @f.fastcc()
382 ; CHECK: declare fastcc void @f.fastcc()
383 declare coldcc void @f.coldcc()
384 ; CHECK: declare coldcc void @f.coldcc()
385 declare cc10 void @f.cc10()
386 ; CHECK: declare ghccc void @f.cc10()
387 declare ghccc void @f.ghccc()
388 ; CHECK: declare ghccc void @f.ghccc()
389 declare cc11 void @f.cc11()
390 ; CHECK: declare cc11 void @f.cc11()
391 declare webkit_jscc void @f.webkit_jscc()
392 ; CHECK: declare webkit_jscc void @f.webkit_jscc()
393 declare anyregcc void @f.anyregcc()
394 ; CHECK: declare anyregcc void @f.anyregcc()
395 declare preserve_mostcc void @f.preserve_mostcc()
396 ; CHECK: declare preserve_mostcc void @f.preserve_mostcc()
397 declare preserve_allcc void @f.preserve_allcc()
398 ; CHECK: declare preserve_allcc void @f.preserve_allcc()
399 declare swifttailcc void @f.swifttailcc()
400 ; CHECK: declare swifttailcc void @f.swifttailcc()
401 declare cc64 void @f.cc64()
402 ; CHECK: declare x86_stdcallcc void @f.cc64()
403 declare x86_stdcallcc void @f.x86_stdcallcc()
404 ; CHECK: declare x86_stdcallcc void @f.x86_stdcallcc()
405 declare cc65 void @f.cc65()
406 ; CHECK: declare x86_fastcallcc void @f.cc65()
407 declare x86_fastcallcc void @f.x86_fastcallcc()
408 ; CHECK: declare x86_fastcallcc void @f.x86_fastcallcc()
409 declare cc66 void @f.cc66()
410 ; CHECK: declare arm_apcscc void @f.cc66()
411 declare arm_apcscc void @f.arm_apcscc()
412 ; CHECK: declare arm_apcscc void @f.arm_apcscc()
413 declare cc67 void @f.cc67()
414 ; CHECK: declare arm_aapcscc void @f.cc67()
415 declare arm_aapcscc void @f.arm_aapcscc()
416 ; CHECK: declare arm_aapcscc void @f.arm_aapcscc()
417 declare cc68 void @f.cc68()
418 ; CHECK: declare arm_aapcs_vfpcc void @f.cc68()
419 declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
420 ; CHECK: declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
421 declare cc69 void @f.cc69()
422 ; CHECK: declare msp430_intrcc void @f.cc69()
423 declare msp430_intrcc void @f.msp430_intrcc()
424 ; CHECK: declare msp430_intrcc void @f.msp430_intrcc()
425 declare cc70 void @f.cc70()
426 ; CHECK: declare x86_thiscallcc void @f.cc70()
427 declare x86_thiscallcc void @f.x86_thiscallcc()
428 ; CHECK: declare x86_thiscallcc void @f.x86_thiscallcc()
429 declare cc71 void @f.cc71()
430 ; CHECK: declare ptx_kernel void @f.cc71()
431 declare ptx_kernel void @f.ptx_kernel()
432 ; CHECK: declare ptx_kernel void @f.ptx_kernel()
433 declare cc72 void @f.cc72()
434 ; CHECK: declare ptx_device void @f.cc72()
435 declare ptx_device void @f.ptx_device()
436 ; CHECK: declare ptx_device void @f.ptx_device()
437 declare cc75 void @f.cc75()
438 ; CHECK: declare spir_func void @f.cc75()
439 declare spir_func void @f.spir_func()
440 ; CHECK: declare spir_func void @f.spir_func()
441 declare cc76 void @f.cc76()
442 ; CHECK: declare spir_kernel void @f.cc76()
443 declare spir_kernel void @f.spir_kernel()
444 ; CHECK: declare spir_kernel void @f.spir_kernel()
445 declare cc77 void @f.cc77()
446 ; CHECK: declare intel_ocl_bicc void @f.cc77()
447 declare intel_ocl_bicc void @f.intel_ocl_bicc()
448 ; CHECK: declare intel_ocl_bicc void @f.intel_ocl_bicc()
449 declare cc78 void @f.cc78()
450 ; CHECK: declare x86_64_sysvcc void @f.cc78()
451 declare x86_64_sysvcc void @f.x86_64_sysvcc()
452 ; CHECK: declare x86_64_sysvcc void @f.x86_64_sysvcc()
453 declare cc79 void @f.cc79()
454 ; CHECK: declare win64cc void @f.cc79()
455 declare win64cc void @f.win64cc()
456 ; CHECK: declare win64cc void @f.win64cc()
457 declare cc80 void @f.cc80()
458 ; CHECK: declare x86_vectorcallcc void @f.cc80()
459 declare x86_vectorcallcc void @f.x86_vectorcallcc()
460 ; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc()
461 declare cc81 void @f.cc81()
462 ; CHECK: declare hhvmcc void @f.cc81()
463 declare hhvmcc void @f.hhvmcc()
464 ; CHECK: declare hhvmcc void @f.hhvmcc()
465 declare cc82 void @f.cc82()
466 ; CHECK: declare hhvm_ccc void @f.cc82()
467 declare hhvm_ccc void @f.hhvm_ccc()
468 ; CHECK: declare hhvm_ccc void @f.hhvm_ccc()
469 declare cc83 void @f.cc83(ptr byval(i8))
470 ; CHECK: declare x86_intrcc void @f.cc83(ptr byval(i8))
471 declare x86_intrcc void @f.x86_intrcc(ptr byval(i8))
472 ; CHECK: declare x86_intrcc void @f.x86_intrcc(ptr byval(i8))
473 declare cc84 void @f.cc84()
474 ; CHECK: declare avr_intrcc void @f.cc84()
475 declare avr_intrcc void @f.avr_intrcc()
476 ; CHECK: declare avr_intrcc void @f.avr_intrcc()
477 declare cc85 void @f.cc85()
478 ; CHECK: declare avr_signalcc void @f.cc85()
479 declare avr_signalcc void @f.avr_signalcc()
480 ; CHECK: declare avr_signalcc void @f.avr_signalcc()
481 declare cc87 void @f.cc87()
482 ; CHECK: declare amdgpu_vs void @f.cc87()
483 declare amdgpu_vs void @f.amdgpu_vs()
484 ; CHECK: declare amdgpu_vs void @f.amdgpu_vs()
485 declare cc88 void @f.cc88()
486 ; CHECK: declare amdgpu_gs void @f.cc88()
487 declare amdgpu_gs void @f.amdgpu_gs()
488 ; CHECK: declare amdgpu_gs void @f.amdgpu_gs()
489 declare cc89 void @f.cc89()
490 ; CHECK: declare amdgpu_ps void @f.cc89()
491 declare amdgpu_ps void @f.amdgpu_ps()
492 ; CHECK: declare amdgpu_ps void @f.amdgpu_ps()
493 declare cc90 void @f.cc90()
494 ; CHECK: declare amdgpu_cs void @f.cc90()
495 declare amdgpu_cs void @f.amdgpu_cs()
496 ; CHECK: declare amdgpu_cs void @f.amdgpu_cs()
497 declare amdgpu_gfx void @f.amdgpu_gfx()
498 ; CHECK: declare amdgpu_gfx void @f.amdgpu_gfx()
499 declare cc91 void @f.cc91()
500 ; CHECK: declare amdgpu_kernel void @f.cc91()
501 declare amdgpu_kernel void @f.amdgpu_kernel()
502 ; CHECK: declare amdgpu_kernel void @f.amdgpu_kernel()
503 declare cc93 void @f.cc93()
504 ; CHECK: declare amdgpu_hs void @f.cc93()
505 declare amdgpu_hs void @f.amdgpu_hs()
506 ; CHECK: declare amdgpu_hs void @f.amdgpu_hs()
507 declare cc95 void @f.cc95()
508 ; CHECK: declare amdgpu_ls void @f.cc95()
509 declare amdgpu_ls void @f.amdgpu_ls()
510 ; CHECK: declare amdgpu_ls void @f.amdgpu_ls()
511 declare cc96 void @f.cc96()
512 ; CHECK: declare amdgpu_es void @f.cc96()
513 declare amdgpu_es void @f.amdgpu_es()
514 ; CHECK: declare amdgpu_es void @f.amdgpu_es()
515 declare cc1023 void @f.cc1023()
516 ; CHECK: declare cc1023 void @f.cc1023()
518 ; Functions -- ret attrs (Return attributes)
519 declare zeroext i64 @f.zeroext()
520 ; CHECK: declare zeroext i64 @f.zeroext()
521 declare signext i64 @f.signext()
522 ; CHECK: declare signext i64 @f.signext()
523 declare inreg ptr @f.inreg()
524 ; CHECK: declare inreg ptr @f.inreg()
525 declare noalias ptr @f.noalias()
526 ; CHECK: declare noalias ptr @f.noalias()
527 declare nonnull ptr @f.nonnull()
528 ; CHECK: declare nonnull ptr @f.nonnull()
529 declare dereferenceable(4) ptr @f.dereferenceable4()
530 ; CHECK: declare dereferenceable(4) ptr @f.dereferenceable4()
531 declare dereferenceable(8) ptr @f.dereferenceable8()
532 ; CHECK: declare dereferenceable(8) ptr @f.dereferenceable8()
533 declare dereferenceable(16) ptr @f.dereferenceable16()
534 ; CHECK: declare dereferenceable(16) ptr @f.dereferenceable16()
535 declare dereferenceable_or_null(4) ptr @f.dereferenceable4_or_null()
536 ; CHECK: declare dereferenceable_or_null(4) ptr @f.dereferenceable4_or_null()
537 declare dereferenceable_or_null(8) ptr @f.dereferenceable8_or_null()
538 ; CHECK: declare dereferenceable_or_null(8) ptr @f.dereferenceable8_or_null()
539 declare dereferenceable_or_null(16) ptr @f.dereferenceable16_or_null()
540 ; CHECK: declare dereferenceable_or_null(16) ptr @f.dereferenceable16_or_null()
542 ; Functions -- Parameter attributes
543 declare void @f.param.zeroext(i8 zeroext)
544 ; CHECK: declare void @f.param.zeroext(i8 zeroext)
545 declare void @f.param.signext(i8 signext)
546 ; CHECK: declare void @f.param.signext(i8 signext)
547 declare void @f.param.inreg(i8 inreg)
548 ; CHECK: declare void @f.param.inreg(i8 inreg)
549 declare void @f.param.byval(ptr byval({ i8, i8 }))
550 ; CHECK: declare void @f.param.byval(ptr byval({ i8, i8 }))
551 declare void @f.param.inalloca(ptr inalloca(i8))
552 ; CHECK: declare void @f.param.inalloca(ptr inalloca(i8))
553 declare void @f.param.sret(ptr sret(i8))
554 ; CHECK: declare void @f.param.sret(ptr sret(i8))
555 declare void @f.param.noalias(ptr noalias)
556 ; CHECK: declare void @f.param.noalias(ptr noalias)
557 declare void @f.param.nocapture(ptr nocapture)
558 ; CHECK: declare void @f.param.nocapture(ptr nocapture)
559 declare void @f.param.nest(ptr nest)
560 ; CHECK: declare void @f.param.nest(ptr nest)
561 declare ptr @f.param.returned(ptr returned)
562 ; CHECK: declare ptr @f.param.returned(ptr returned)
563 declare void @f.param.nonnull(ptr nonnull)
564 ; CHECK: declare void @f.param.nonnull(ptr nonnull)
565 declare void @f.param.dereferenceable(ptr dereferenceable(4))
566 ; CHECK: declare void @f.param.dereferenceable(ptr dereferenceable(4))
567 declare void @f.param.dereferenceable_or_null(ptr dereferenceable_or_null(4))
568 ; CHECK: declare void @f.param.dereferenceable_or_null(ptr dereferenceable_or_null(4))
569 declare void @f.param.stack_align([2 x double] alignstack(16))
570 ; CHECK: declare void @f.param.stack_align([2 x double] alignstack(16))
571 declare void @f.param.swiftself(ptr swiftself)
572 ; CHECK: declare void @f.param.swiftself(ptr swiftself)
573 declare void @f.param.swiftasync(ptr swiftasync)
574 ; CHECK: declare void @f.param.swiftasync(ptr swiftasync)
575 declare void @f.param.swifterror(ptr swifterror)
576 ; CHECK: declare void @f.param.swifterror(ptr swifterror)
577 declare void @f.param.allocalign(i32 allocalign)
578 ; CHECK: declare void @f.param.allocalign(i32 allocalign)
579 declare void @f.param.allocptr(ptr allocptr)
580 ; CHECK: declare void @f.param.allocptr(ptr allocptr)
582 ; Functions -- unnamed_addr and local_unnamed_addr
583 declare void @f.unnamed_addr() unnamed_addr
584 ; CHECK: declare void @f.unnamed_addr() unnamed_addr
585 declare void @f.local_unnamed_addr() local_unnamed_addr
586 ; CHECK: declare void @f.local_unnamed_addr() local_unnamed_addr
588 ; Functions -- fn Attrs (Function attributes)
589 declare void @f.alignstack4() alignstack(4)
590 ; CHECK: declare void @f.alignstack4() #0
591 declare void @f.alignstack8() alignstack(8)
592 ; CHECK: declare void @f.alignstack8() #1
593 declare void @f.alwaysinline() alwaysinline
594 ; CHECK: declare void @f.alwaysinline() #2
595 declare void @f.cold() cold
596 ; CHECK: declare void @f.cold() #3
597 declare void @f.convergent() convergent
598 ; CHECK: declare void @f.convergent() #4
599 declare void @f.inlinehint() inlinehint
600 ; CHECK: declare void @f.inlinehint() #5
601 declare void @f.jumptable() unnamed_addr jumptable
602 ; CHECK: declare void @f.jumptable() unnamed_addr #6
603 declare void @f.minsize() minsize
604 ; CHECK: declare void @f.minsize() #7
605 declare void @f.naked() naked
606 ; CHECK: declare void @f.naked() #8
607 declare void @f.nobuiltin() nobuiltin
608 ; CHECK: declare void @f.nobuiltin() #9
609 declare void @f.noduplicate() noduplicate
610 ; CHECK: declare void @f.noduplicate() #10
611 declare void @f.noimplicitfloat() noimplicitfloat
612 ; CHECK: declare void @f.noimplicitfloat() #11
613 declare void @f.noinline() noinline
614 ; CHECK: declare void @f.noinline() #12
615 declare void @f.nonlazybind() nonlazybind
616 ; CHECK: declare void @f.nonlazybind() #13
617 declare void @f.noredzone() noredzone
618 ; CHECK: declare void @f.noredzone() #14
619 declare void @f.noreturn() noreturn
620 ; CHECK: declare void @f.noreturn() #15
621 declare void @f.nounwind() nounwind
622 ; CHECK: declare void @f.nounwind() #16
623 declare void @f.optnone() noinline optnone
624 ; CHECK: declare void @f.optnone() #17
625 declare void @f.optsize() optsize
626 ; CHECK: declare void @f.optsize() #18
627 declare void @f.readnone() readnone
628 ; CHECK: declare void @f.readnone() #19
629 declare void @f.readonly() readonly
630 ; CHECK: declare void @f.readonly() #20
631 declare void @f.returns_twice() returns_twice
632 ; CHECK: declare void @f.returns_twice() #21
633 declare void @f.safestack() safestack
634 ; CHECK: declare void @f.safestack() #22
635 declare void @f.sanitize_address() sanitize_address
636 ; CHECK: declare void @f.sanitize_address() #23
637 declare void @f.sanitize_memory() sanitize_memory
638 ; CHECK: declare void @f.sanitize_memory() #24
639 declare void @f.sanitize_thread() sanitize_thread
640 ; CHECK: declare void @f.sanitize_thread() #25
641 declare void @f.ssp() ssp
642 ; CHECK: declare void @f.ssp() #26
643 declare void @f.sspreq() sspreq
644 ; CHECK: declare void @f.sspreq() #27
645 declare void @f.sspstrong() sspstrong
646 ; CHECK: declare void @f.sspstrong() #28
647 declare void @f.thunk() "thunk"
648 ; CHECK: declare void @f.thunk() #29
649 declare void @f.uwtable() uwtable
650 ; CHECK: declare void @f.uwtable() #30
651 declare void @f.kvpair() "cpu"="cortex-a8"
652 ; CHECK:declare void @f.kvpair() #31
653 declare void @f.norecurse() norecurse
654 ; CHECK: declare void @f.norecurse() #32
655 declare void @f.inaccessiblememonly() inaccessiblememonly
656 ; CHECK: declare void @f.inaccessiblememonly() #33
657 declare void @f.inaccessiblemem_or_argmemonly() inaccessiblemem_or_argmemonly
658 ; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #34
659 declare void @f.strictfp() #35
661 ; Functions -- section
662 declare void @f.section() section "80"
663 ; CHECK: declare void @f.section() section "80"
665 ; Functions -- partition
666 define void @f.partition() partition "part" {
667 ; CHECK: define void @f.partition() partition "part"
671 ; Functions -- comdat
672 define void @f.comdat_any() comdat($comdat.any) {
673 ; CHECK: define void @f.comdat_any() comdat($comdat.any)
677 define void @f.comdat_exactmatch() comdat($comdat.exactmatch) {
678 ; CHECK: define void @f.comdat_exactmatch() comdat($comdat.exactmatch)
682 define void @f.comdat_largest() comdat($comdat.largest) {
683 ; CHECK: define void @f.comdat_largest() comdat($comdat.largest)
687 define void @f.comdat_noduplicates() comdat($comdat.noduplicates) {
688 ; CHECK: define void @f.comdat_noduplicates() comdat($comdat.noduplicates)
692 define void @f.comdat_samesize() comdat($comdat.samesize) {
693 ; CHECK: define void @f.comdat_samesize() comdat($comdat.samesize)
699 declare void @f.align2() align 2
700 ; CHECK: declare void @f.align2() align 2
701 declare void @f.align4() align 4
702 ; CHECK: declare void @f.align4() align 4
703 declare void @f.align8() align 8
704 ; CHECK: declare void @f.align8() align 8
707 declare void @f.gcshadow() gc "shadow-stack"
708 ; CHECK: declare void @f.gcshadow() gc "shadow-stack"
710 ; Functions -- Prefix data
711 declare void @f.prefixi32() prefix i32 1684365668
712 ; CHECK: declare void @f.prefixi32() prefix i32 1684365668
713 declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
714 ; CHECK: declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
716 ; Functions -- Prologue data
717 declare void @f.prologuei32() prologue i32 1684365669
718 ; CHECK: declare void @f.prologuei32() prologue i32 1684365669
719 declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
720 ; CHECK: declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
722 ; Functions -- Personality constant
723 declare void @llvm.donothing() nounwind readnone
724 ; CHECK: declare void @llvm.donothing() #35
725 define void @f.no_personality() personality i8 3 {
726 ; CHECK: define void @f.no_personality() personality i8 3
727 invoke void @llvm.donothing() to label %normal unwind label %exception
729 %cleanup = landingpad i8 cleanup
735 declare i32 @f.personality_handler()
736 ; CHECK: declare i32 @f.personality_handler()
737 define void @f.personality() personality ptr @f.personality_handler {
738 ; CHECK: define void @f.personality() personality ptr @f.personality_handler
739 invoke void @llvm.donothing() to label %normal unwind label %exception
741 %cleanup = landingpad i32 cleanup
747 ;; Atomic Memory Ordering Constraints
748 define void @atomics(ptr %word) {
749 ;; Atomic Compare And Exchange w/o alignment
750 %cmpxchg_no_align.0 = cmpxchg ptr %word, i32 0, i32 4 monotonic monotonic
751 ; CHECK: %cmpxchg_no_align.0 = cmpxchg ptr %word, i32 0, i32 4 monotonic monotonic
752 %cmpxchg_no_align.1 = cmpxchg ptr %word, i32 0, i32 5 acq_rel monotonic
753 ; CHECK: %cmpxchg_no_align.1 = cmpxchg ptr %word, i32 0, i32 5 acq_rel monotonic
754 %cmpxchg_no_align.2 = cmpxchg ptr %word, i32 0, i32 6 acquire monotonic
755 ; CHECK: %cmpxchg_no_align.2 = cmpxchg ptr %word, i32 0, i32 6 acquire monotonic
756 %cmpxchg_no_align.3 = cmpxchg ptr %word, i32 0, i32 7 release monotonic
757 ; CHECK: %cmpxchg_no_align.3 = cmpxchg ptr %word, i32 0, i32 7 release monotonic
758 %cmpxchg_no_align.4 = cmpxchg ptr %word, i32 0, i32 8 seq_cst monotonic
759 ; CHECK: %cmpxchg_no_align.4 = cmpxchg ptr %word, i32 0, i32 8 seq_cst monotonic
760 %cmpxchg_no_align.5 = cmpxchg weak ptr %word, i32 0, i32 9 seq_cst monotonic
761 ; CHECK: %cmpxchg_no_align.5 = cmpxchg weak ptr %word, i32 0, i32 9 seq_cst monotonic
762 %cmpxchg_no_align.6 = cmpxchg volatile ptr %word, i32 0, i32 10 seq_cst monotonic
763 ; CHECK: %cmpxchg_no_align.6 = cmpxchg volatile ptr %word, i32 0, i32 10 seq_cst monotonic
764 %cmpxchg_no_align.7 = cmpxchg weak volatile ptr %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
765 ; CHECK: %cmpxchg_no_align.7 = cmpxchg weak volatile ptr %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
767 ;; Atomic Compare And Exchange w/ alignment
768 %cmpxchg.0 = cmpxchg ptr %word, i32 0, i32 4 monotonic monotonic, align 16
769 ; CHECK: %cmpxchg.0 = cmpxchg ptr %word, i32 0, i32 4 monotonic monotonic, align 16
770 %cmpxchg.1 = cmpxchg ptr %word, i32 0, i32 5 acq_rel monotonic, align 16
771 ; CHECK: %cmpxchg.1 = cmpxchg ptr %word, i32 0, i32 5 acq_rel monotonic, align 16
772 %cmpxchg.2 = cmpxchg ptr %word, i32 0, i32 6 acquire monotonic, align 16
773 ; CHECK: %cmpxchg.2 = cmpxchg ptr %word, i32 0, i32 6 acquire monotonic, align 16
774 %cmpxchg.3 = cmpxchg ptr %word, i32 0, i32 7 release monotonic, align 16
775 ; CHECK: %cmpxchg.3 = cmpxchg ptr %word, i32 0, i32 7 release monotonic, align 16
776 %cmpxchg.4 = cmpxchg ptr %word, i32 0, i32 8 seq_cst monotonic, align 16
777 ; CHECK: %cmpxchg.4 = cmpxchg ptr %word, i32 0, i32 8 seq_cst monotonic, align 16
778 %cmpxchg.5 = cmpxchg weak ptr %word, i32 0, i32 9 seq_cst monotonic, align 16
779 ; CHECK: %cmpxchg.5 = cmpxchg weak ptr %word, i32 0, i32 9 seq_cst monotonic, align 16
780 %cmpxchg.6 = cmpxchg volatile ptr %word, i32 0, i32 10 seq_cst monotonic, align 16
781 ; CHECK: %cmpxchg.6 = cmpxchg volatile ptr %word, i32 0, i32 10 seq_cst monotonic, align 16
782 %cmpxchg.7 = cmpxchg weak volatile ptr %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic, align 16
783 ; CHECK: %cmpxchg.7 = cmpxchg weak volatile ptr %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic, align 16
785 ;; Atomic w/o alignment
786 %atomicrmw_no_align.xchg = atomicrmw xchg ptr %word, i32 12 monotonic
787 ; CHECK: %atomicrmw_no_align.xchg = atomicrmw xchg ptr %word, i32 12 monotonic
788 %atomicrmw_no_align.add = atomicrmw add ptr %word, i32 13 monotonic
789 ; CHECK: %atomicrmw_no_align.add = atomicrmw add ptr %word, i32 13 monotonic
790 %atomicrmw_no_align.sub = atomicrmw sub ptr %word, i32 14 monotonic
791 ; CHECK: %atomicrmw_no_align.sub = atomicrmw sub ptr %word, i32 14 monotonic
792 %atomicrmw_no_align.and = atomicrmw and ptr %word, i32 15 monotonic
793 ; CHECK: %atomicrmw_no_align.and = atomicrmw and ptr %word, i32 15 monotonic
794 %atomicrmw_no_align.nand = atomicrmw nand ptr %word, i32 16 monotonic
795 ; CHECK: %atomicrmw_no_align.nand = atomicrmw nand ptr %word, i32 16 monotonic
796 %atomicrmw_no_align.or = atomicrmw or ptr %word, i32 17 monotonic
797 ; CHECK: %atomicrmw_no_align.or = atomicrmw or ptr %word, i32 17 monotonic
798 %atomicrmw_no_align.xor = atomicrmw xor ptr %word, i32 18 monotonic
799 ; CHECK: %atomicrmw_no_align.xor = atomicrmw xor ptr %word, i32 18 monotonic
800 %atomicrmw_no_align.max = atomicrmw max ptr %word, i32 19 monotonic
801 ; CHECK: %atomicrmw_no_align.max = atomicrmw max ptr %word, i32 19 monotonic
802 %atomicrmw_no_align.min = atomicrmw volatile min ptr %word, i32 20 monotonic
803 ; CHECK: %atomicrmw_no_align.min = atomicrmw volatile min ptr %word, i32 20 monotonic
804 %atomicrmw_no_align.umax = atomicrmw umax ptr %word, i32 21 syncscope("singlethread") monotonic
805 ; CHECK: %atomicrmw_no_align.umax = atomicrmw umax ptr %word, i32 21 syncscope("singlethread") monotonic
806 %atomicrmw_no_align.umin = atomicrmw volatile umin ptr %word, i32 22 syncscope("singlethread") monotonic
807 ; CHECK: %atomicrmw_no_align.umin = atomicrmw volatile umin ptr %word, i32 22 syncscope("singlethread") monotonic
809 ;; Atomic w/ alignment
810 %atomicrmw.xchg = atomicrmw xchg ptr %word, i32 12 monotonic, align 16
811 ; CHECK: %atomicrmw.xchg = atomicrmw xchg ptr %word, i32 12 monotonic, align 16
812 %atomicrmw.add = atomicrmw add ptr %word, i32 13 monotonic, align 16
813 ; CHECK: %atomicrmw.add = atomicrmw add ptr %word, i32 13 monotonic, align 16
814 %atomicrmw.sub = atomicrmw sub ptr %word, i32 14 monotonic, align 16
815 ; CHECK: %atomicrmw.sub = atomicrmw sub ptr %word, i32 14 monotonic, align 16
816 %atomicrmw.and = atomicrmw and ptr %word, i32 15 monotonic, align 16
817 ; CHECK: %atomicrmw.and = atomicrmw and ptr %word, i32 15 monotonic, align 16
818 %atomicrmw.nand = atomicrmw nand ptr %word, i32 16 monotonic, align 16
819 ; CHECK: %atomicrmw.nand = atomicrmw nand ptr %word, i32 16 monotonic, align 16
820 %atomicrmw.or = atomicrmw or ptr %word, i32 17 monotonic, align 16
821 ; CHECK: %atomicrmw.or = atomicrmw or ptr %word, i32 17 monotonic, align 16
822 %atomicrmw.xor = atomicrmw xor ptr %word, i32 18 monotonic, align 16
823 ; CHECK: %atomicrmw.xor = atomicrmw xor ptr %word, i32 18 monotonic, align 16
824 %atomicrmw.max = atomicrmw max ptr %word, i32 19 monotonic, align 16
825 ; CHECK: %atomicrmw.max = atomicrmw max ptr %word, i32 19 monotonic, align 16
826 %atomicrmw.min = atomicrmw volatile min ptr %word, i32 20 monotonic, align 16
827 ; CHECK: %atomicrmw.min = atomicrmw volatile min ptr %word, i32 20 monotonic, align 16
828 %atomicrmw.umax = atomicrmw umax ptr %word, i32 21 syncscope("singlethread") monotonic, align 16
829 ; CHECK: %atomicrmw.umax = atomicrmw umax ptr %word, i32 21 syncscope("singlethread") monotonic, align 16
830 %atomicrmw.umin = atomicrmw volatile umin ptr %word, i32 22 syncscope("singlethread") monotonic, align 16
831 ; CHECK: %atomicrmw.umin = atomicrmw volatile umin ptr %word, i32 22 syncscope("singlethread") monotonic, align 16
834 ; CHECK: fence acquire
836 ; CHECK: fence release
838 ; CHECK: fence acq_rel
839 fence syncscope("singlethread") seq_cst
840 ; CHECK: fence syncscope("singlethread") seq_cst
842 %ld.1 = load atomic i32, ptr %word monotonic, align 4
843 ; CHECK: %ld.1 = load atomic i32, ptr %word monotonic, align 4
844 %ld.2 = load atomic volatile i32, ptr %word acquire, align 8
845 ; CHECK: %ld.2 = load atomic volatile i32, ptr %word acquire, align 8
846 %ld.3 = load atomic volatile i32, ptr %word syncscope("singlethread") seq_cst, align 16
847 ; CHECK: %ld.3 = load atomic volatile i32, ptr %word syncscope("singlethread") seq_cst, align 16
849 store atomic i32 23, ptr %word monotonic, align 4
850 ; CHECK: store atomic i32 23, ptr %word monotonic, align 4
851 store atomic volatile i32 24, ptr %word monotonic, align 4
852 ; CHECK: store atomic volatile i32 24, ptr %word monotonic, align 4
853 store atomic volatile i32 25, ptr %word syncscope("singlethread") monotonic, align 4
854 ; CHECK: store atomic volatile i32 25, ptr %word syncscope("singlethread") monotonic, align 4
858 define void @fp_atomics(ptr %word) {
859 ; CHECK: %atomicrmw.xchg = atomicrmw xchg ptr %word, float 1.000000e+00 monotonic
860 %atomicrmw.xchg = atomicrmw xchg ptr %word, float 1.0 monotonic
862 ; CHECK: %atomicrmw.fadd = atomicrmw fadd ptr %word, float 1.000000e+00 monotonic
863 %atomicrmw.fadd = atomicrmw fadd ptr %word, float 1.0 monotonic
865 ; CHECK: %atomicrmw.fsub = atomicrmw fsub ptr %word, float 1.000000e+00 monotonic
866 %atomicrmw.fsub = atomicrmw fsub ptr %word, float 1.0 monotonic
868 ; CHECK: %atomicrmw.fmax = atomicrmw fmax ptr %word, float 1.000000e+00 monotonic
869 %atomicrmw.fmax = atomicrmw fmax ptr %word, float 1.0 monotonic
871 ; CHECK: %atomicrmw.fmin = atomicrmw fmin ptr %word, float 1.000000e+00 monotonic
872 %atomicrmw.fmin = atomicrmw fmin ptr %word, float 1.0 monotonic
877 define void @uinc_udec_wrap_atomics(ptr %word) {
878 ; CHECK: %atomicrmw.inc0 = atomicrmw uinc_wrap ptr %word, i32 64 monotonic
879 %atomicrmw.inc0 = atomicrmw uinc_wrap ptr %word, i32 64 monotonic
881 ; CHECK: %atomicrmw.inc1 = atomicrmw uinc_wrap ptr %word, i32 128 seq_cst
882 %atomicrmw.inc1 = atomicrmw uinc_wrap ptr %word, i32 128 seq_cst
884 ; CHECK: %atomicrmw.inc2 = atomicrmw volatile uinc_wrap ptr %word, i32 128 seq_cst
885 %atomicrmw.inc2 = atomicrmw volatile uinc_wrap ptr %word, i32 128 seq_cst
887 ; CHECK: %atomicrmw.inc0.syncscope = atomicrmw uinc_wrap ptr %word, i32 27 syncscope("agent") monotonic
888 %atomicrmw.inc0.syncscope = atomicrmw uinc_wrap ptr %word, i32 27 syncscope("agent") monotonic
890 ; CHECK: %atomicrmw.dec0 = atomicrmw udec_wrap ptr %word, i32 99 monotonic
891 %atomicrmw.dec0 = atomicrmw udec_wrap ptr %word, i32 99 monotonic
893 ; CHECK: %atomicrmw.dec1 = atomicrmw udec_wrap ptr %word, i32 12 seq_cst
894 %atomicrmw.dec1 = atomicrmw udec_wrap ptr %word, i32 12 seq_cst
896 ; CHECK: %atomicrmw.dec2 = atomicrmw volatile udec_wrap ptr %word, i32 12 seq_cst
897 %atomicrmw.dec2 = atomicrmw volatile udec_wrap ptr %word, i32 12 seq_cst
899 ; CHECK: %atomicrmw.dec0.syncscope = atomicrmw udec_wrap ptr %word, i32 5 syncscope("system") monotonic
900 %atomicrmw.dec0.syncscope = atomicrmw udec_wrap ptr %word, i32 5 syncscope("system") monotonic
905 define void @pointer_atomics(ptr %word) {
906 ; CHECK: %atomicrmw.xchg = atomicrmw xchg ptr %word, ptr null monotonic
907 %atomicrmw.xchg = atomicrmw xchg ptr %word, ptr null monotonic
912 define void @fastmathflags_unop(float %op1) {
913 %f.nnan = fneg nnan float %op1
914 ; CHECK: %f.nnan = fneg nnan float %op1
915 %f.ninf = fneg ninf float %op1
916 ; CHECK: %f.ninf = fneg ninf float %op1
917 %f.nsz = fneg nsz float %op1
918 ; CHECK: %f.nsz = fneg nsz float %op1
919 %f.arcp = fneg arcp float %op1
920 ; CHECK: %f.arcp = fneg arcp float %op1
921 %f.contract = fneg contract float %op1
922 ; CHECK: %f.contract = fneg contract float %op1
923 %f.afn = fneg afn float %op1
924 ; CHECK: %f.afn = fneg afn float %op1
925 %f.reassoc = fneg reassoc float %op1
926 ; CHECK: %f.reassoc = fneg reassoc float %op1
927 %f.fast = fneg fast float %op1
928 ; CHECK: %f.fast = fneg fast float %op1
932 define void @fastmathflags_binops(float %op1, float %op2) {
933 %f.nnan = fadd nnan float %op1, %op2
934 ; CHECK: %f.nnan = fadd nnan float %op1, %op2
935 %f.ninf = fadd ninf float %op1, %op2
936 ; CHECK: %f.ninf = fadd ninf float %op1, %op2
937 %f.nsz = fadd nsz float %op1, %op2
938 ; CHECK: %f.nsz = fadd nsz float %op1, %op2
939 %f.arcp = fadd arcp float %op1, %op2
940 ; CHECK: %f.arcp = fadd arcp float %op1, %op2
941 %f.contract = fadd contract float %op1, %op2
942 ; CHECK: %f.contract = fadd contract float %op1, %op2
943 %f.afn = fadd afn float %op1, %op2
944 ; CHECK: %f.afn = fadd afn float %op1, %op2
945 %f.reassoc = fadd reassoc float %op1, %op2
946 ; CHECK: %f.reassoc = fadd reassoc float %op1, %op2
947 %f.fast = fadd fast float %op1, %op2
948 ; CHECK: %f.fast = fadd fast float %op1, %op2
952 define void @fastmathflags_select(i1 %cond, float %op1, float %op2) {
953 %f.nnan = select nnan i1 %cond, float %op1, float %op2
954 ; CHECK: %f.nnan = select nnan i1 %cond, float %op1, float %op2
955 %f.ninf = select ninf i1 %cond, float %op1, float %op2
956 ; CHECK: %f.ninf = select ninf i1 %cond, float %op1, float %op2
957 %f.nsz = select nsz i1 %cond, float %op1, float %op2
958 ; CHECK: %f.nsz = select nsz i1 %cond, float %op1, float %op2
959 %f.arcp = select arcp i1 %cond, float %op1, float %op2
960 ; CHECK: %f.arcp = select arcp i1 %cond, float %op1, float %op2
961 %f.contract = select contract i1 %cond, float %op1, float %op2
962 ; CHECK: %f.contract = select contract i1 %cond, float %op1, float %op2
963 %f.afn = select afn i1 %cond, float %op1, float %op2
964 ; CHECK: %f.afn = select afn i1 %cond, float %op1, float %op2
965 %f.reassoc = select reassoc i1 %cond, float %op1, float %op2
966 ; CHECK: %f.reassoc = select reassoc i1 %cond, float %op1, float %op2
967 %f.fast = select fast i1 %cond, float %op1, float %op2
968 ; CHECK: %f.fast = select fast i1 %cond, float %op1, float %op2
972 define void @fastmathflags_vector_select(<2 x i1> %cond, <2 x double> %op1, <2 x double> %op2) {
973 %f.nnan.nsz = select nnan nsz <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
974 ; CHECK: %f.nnan.nsz = select nnan nsz <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
975 %f.fast = select fast <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
976 ; CHECK: %f.fast = select fast <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
980 define void @fastmathflags_array_select(i1 %cond, [2 x double] %op1, [2 x double] %op2) {
981 %f.nnan.nsz = select nnan nsz i1 %cond, [2 x double] %op1, [2 x double] %op2
982 ; CHECK: %f.nnan.nsz = select nnan nsz i1 %cond, [2 x double] %op1, [2 x double] %op2
983 %f.fast = select fast i1 %cond, [2 x double] %op1, [2 x double] %op2
984 ; CHECK: %f.fast = select fast i1 %cond, [2 x double] %op1, [2 x double] %op2
988 define void @fastmathflags_phi(i1 %cond, float %f1, float %f2, double %d1, double %d2, half %h1, half %h2) {
990 br i1 %cond, label %L1, label %L2
996 %p.nnan = phi nnan float [ %f1, %L1 ], [ %f2, %L2 ]
997 ; CHECK: %p.nnan = phi nnan float [ %f1, %L1 ], [ %f2, %L2 ]
998 %p.ninf = phi ninf double [ %d1, %L1 ], [ %d2, %L2 ]
999 ; CHECK: %p.ninf = phi ninf double [ %d1, %L1 ], [ %d2, %L2 ]
1000 %p.contract = phi contract half [ %h1, %L1 ], [ %h2, %L2 ]
1001 ; CHECK: %p.contract = phi contract half [ %h1, %L1 ], [ %h2, %L2 ]
1002 %p.nsz.reassoc = phi reassoc nsz float [ %f1, %L1 ], [ %f2, %L2 ]
1003 ; CHECK: %p.nsz.reassoc = phi reassoc nsz float [ %f1, %L1 ], [ %f2, %L2 ]
1004 %p.fast = phi fast half [ %h2, %L1 ], [ %h1, %L2 ]
1005 ; CHECK: %p.fast = phi fast half [ %h2, %L1 ], [ %h1, %L2 ]
1009 define void @fastmathflags_vector_phi(i1 %cond, <4 x float> %f1, <4 x float> %f2, <2 x double> %d1, <2 x double> %d2, <8 x half> %h1, <8 x half> %h2) {
1011 br i1 %cond, label %L1, label %L2
1017 %p.nnan = phi nnan <4 x float> [ %f1, %L1 ], [ %f2, %L2 ]
1018 ; CHECK: %p.nnan = phi nnan <4 x float> [ %f1, %L1 ], [ %f2, %L2 ]
1019 %p.ninf = phi ninf <2 x double> [ %d1, %L1 ], [ %d2, %L2 ]
1020 ; CHECK: %p.ninf = phi ninf <2 x double> [ %d1, %L1 ], [ %d2, %L2 ]
1021 %p.contract = phi contract <8 x half> [ %h1, %L1 ], [ %h2, %L2 ]
1022 ; CHECK: %p.contract = phi contract <8 x half> [ %h1, %L1 ], [ %h2, %L2 ]
1023 %p.nsz.reassoc = phi reassoc nsz <4 x float> [ %f1, %L1 ], [ %f2, %L2 ]
1024 ; CHECK: %p.nsz.reassoc = phi reassoc nsz <4 x float> [ %f1, %L1 ], [ %f2, %L2 ]
1025 %p.fast = phi fast <8 x half> [ %h2, %L1 ], [ %h1, %L2 ]
1026 ; CHECK: %p.fast = phi fast <8 x half> [ %h2, %L1 ], [ %h1, %L2 ]
1030 define void @fastmathflags_array_phi(i1 %cond, [4 x float] %f1, [4 x float] %f2, [2 x double] %d1, [2 x double] %d2, [8 x half] %h1, [8 x half] %h2) {
1032 br i1 %cond, label %L1, label %L2
1038 %p.nnan = phi nnan [4 x float] [ %f1, %L1 ], [ %f2, %L2 ]
1039 ; CHECK: %p.nnan = phi nnan [4 x float] [ %f1, %L1 ], [ %f2, %L2 ]
1040 %p.ninf = phi ninf [2 x double] [ %d1, %L1 ], [ %d2, %L2 ]
1041 ; CHECK: %p.ninf = phi ninf [2 x double] [ %d1, %L1 ], [ %d2, %L2 ]
1042 %p.contract = phi contract [8 x half] [ %h1, %L1 ], [ %h2, %L2 ]
1043 ; CHECK: %p.contract = phi contract [8 x half] [ %h1, %L1 ], [ %h2, %L2 ]
1044 %p.nsz.reassoc = phi reassoc nsz [4 x float] [ %f1, %L1 ], [ %f2, %L2 ]
1045 ; CHECK: %p.nsz.reassoc = phi reassoc nsz [4 x float] [ %f1, %L1 ], [ %f2, %L2 ]
1046 %p.fast = phi fast [8 x half] [ %h2, %L1 ], [ %h1, %L2 ]
1047 ; CHECK: %p.fast = phi fast [8 x half] [ %h2, %L1 ], [ %h1, %L2 ]
1051 ; Check various fast math flags and floating-point types on calls.
1053 declare float @fmf_f32()
1054 declare double @fmf_f64()
1055 declare <4 x double> @fmf_v4f64()
1057 ; CHECK-LABEL: fastMathFlagsForCalls(
1058 define void @fastMathFlagsForCalls(float %f, double %d1, <4 x double> %d2) {
1059 %call.fast = call fast float @fmf_f32()
1060 ; CHECK: %call.fast = call fast float @fmf_f32()
1062 ; Throw in some other attributes to make sure those stay in the right places.
1064 %call.nsz.arcp = notail call nsz arcp double @fmf_f64()
1065 ; CHECK: %call.nsz.arcp = notail call nsz arcp double @fmf_f64()
1067 %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf_v4f64()
1068 ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf_v4f64()
1073 declare [2 x float] @fmf_a2f32()
1074 declare [2 x double] @fmf_a2f64()
1075 declare [2 x <4 x double>] @fmf_a2v4f64()
1077 ; CHECK-LABEL: fastMathFlagsForArrayCalls(
1078 define void @fastMathFlagsForArrayCalls([2 x float] %f, [2 x double] %d1, [2 x <4 x double>] %d2) {
1079 %call.fast = call fast [2 x float] @fmf_a2f32()
1080 ; CHECK: %call.fast = call fast [2 x float] @fmf_a2f32()
1082 ; Throw in some other attributes to make sure those stay in the right places.
1084 %call.nsz.arcp = notail call nsz arcp [2 x double] @fmf_a2f64()
1085 ; CHECK: %call.nsz.arcp = notail call nsz arcp [2 x double] @fmf_a2f64()
1087 %call.nnan.ninf = tail call nnan ninf fastcc [2 x <4 x double>] @fmf_a2v4f64()
1088 ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc [2 x <4 x double>] @fmf_a2v4f64()
1094 %opaquety = type opaque
1095 define void @typesystem() {
1097 %t0 = alloca i1942652
1098 ; CHECK: %t0 = alloca i1942652
1100 ; CHECK: %t1 = alloca half
1102 ; CHECK: %t2 = alloca float
1104 ; CHECK: %t3 = alloca double
1106 ; CHECK: %t4 = alloca fp128
1107 %t5 = alloca x86_fp80
1108 ; CHECK: %t5 = alloca x86_fp80
1109 %t6 = alloca ppc_fp128
1110 ; CHECK: %t6 = alloca ppc_fp128
1111 %t7 = alloca x86_mmx
1112 ; CHECK: %t7 = alloca x86_mmx
1114 ; CHECK: %t8 = alloca ptr
1115 %t9 = alloca <4 x i32>
1116 ; CHECK: %t9 = alloca <4 x i32>
1117 %t10 = alloca <vscale x 4 x i32>
1118 ; CHECK: %t10 = alloca <vscale x 4 x i32>
1123 declare void @llvm.token(token)
1124 ; CHECK: declare void @llvm.token(token)
1126 ;; Inline Assembler Expressions
1127 define void @inlineasm(i32 %arg) {
1128 call i32 asm "bswap $0", "=r,r"(i32 %arg)
1129 ; CHECK: call i32 asm "bswap $0", "=r,r"(i32 %arg)
1130 call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
1131 ; CHECK: call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
1137 ; Instructions -- Terminators
1138 define void @instructions.terminators(i8 %val) personality i32 -10 {
1139 br i1 false, label %iftrue, label %iffalse
1140 ; CHECK: br i1 false, label %iftrue, label %iffalse
1142 ; CHECK: br label %iftrue
1148 switch i8 %val, label %defaultdest [
1149 ; CHECK: switch i8 %val, label %defaultdest [
1150 i8 0, label %defaultdest.0
1151 ; CHECK: i8 0, label %defaultdest.0
1152 i8 1, label %defaultdest.1
1153 ; CHECK: i8 1, label %defaultdest.1
1154 i8 2, label %defaultdest.2
1155 ; CHECK: i8 2, label %defaultdest.2
1166 indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
1167 ; CHECK: indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
1168 indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
1169 ; CHECK: indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
1171 invoke fastcc void @f.fastcc()
1172 ; CHECK: invoke fastcc void @f.fastcc()
1173 to label %defaultdest unwind label %exc
1174 ; CHECK: to label %defaultdest unwind label %exc
1176 %cleanup = landingpad i32 cleanup
1179 ; CHECK: resume i32 undef
1181 ; CHECK: resume i32 poison
1183 ; CHECK: unreachable
1188 define i32 @instructions.win_eh.1() personality i32 -3 {
1192 invoke void @f.ccc() to label %normal unwind label %catchswitch1
1193 invoke void @f.ccc() to label %normal unwind label %catchswitch2
1194 invoke void @f.ccc() to label %normal unwind label %catchswitch3
1197 %cs1 = catchswitch within none [label %catchpad1] unwind to caller
1200 catchpad within %cs1 []
1202 ; CHECK: catchpad within %cs1 []
1203 ; CHECK-NEXT: br label %normal
1206 %cs2 = catchswitch within none [label %catchpad2] unwind to caller
1209 catchpad within %cs2 [ptr %arg1]
1211 ; CHECK: catchpad within %cs2 [ptr %arg1]
1212 ; CHECK-NEXT: br label %normal
1215 %cs3 = catchswitch within none [label %catchpad3] unwind label %cleanuppad1
1218 catchpad within %cs3 [ptr %arg1, ptr %arg2]
1220 ; CHECK: catchpad within %cs3 [ptr %arg1, ptr %arg2]
1221 ; CHECK-NEXT: br label %normal
1224 %clean.1 = cleanuppad within none []
1226 ; CHECK: %clean.1 = cleanuppad within none []
1227 ; CHECK-NEXT: unreachable
1233 define i32 @instructions.win_eh.2() personality i32 -4 {
1235 invoke void @f.ccc() to label %invoke.cont unwind label %catchswitch
1238 invoke void @f.ccc() to label %continue unwind label %cleanup
1241 %clean = cleanuppad within none []
1242 ; CHECK: %clean = cleanuppad within none []
1243 cleanupret from %clean unwind to caller
1244 ; CHECK: cleanupret from %clean unwind to caller
1247 %cs = catchswitch within none [label %catchpad] unwind label %terminate
1250 %catch = catchpad within %cs []
1252 ; CHECK: %catch = catchpad within %cs []
1253 ; CHECK-NEXT: br label %body
1256 invoke void @f.ccc() [ "funclet"(token %catch) ]
1257 to label %continue unwind label %terminate.inner
1258 catchret from %catch to label %return
1259 ; CHECK: catchret from %catch to label %return
1265 cleanuppad within %catch []
1267 ; CHECK: cleanuppad within %catch []
1268 ; CHECK-NEXT: unreachable
1271 cleanuppad within none []
1273 ; CHECK: cleanuppad within none []
1274 ; CHECK-NEXT: unreachable
1280 ; Instructions -- Unary Operations
1281 define void @instructions.unops(double %op1) {
1283 ; CHECK: fneg double %op1
1287 ; Instructions -- Binary Operations
1288 define void @instructions.binops(i8 %op1, i8 %op2) {
1291 ; CHECK: add i8 %op1, %op2
1292 add nuw i8 %op1, %op2
1293 ; CHECK: add nuw i8 %op1, %op2
1294 add nsw i8 %op1, %op2
1295 ; CHECK: add nsw i8 %op1, %op2
1296 add nuw nsw i8 %op1, %op2
1297 ; CHECK: add nuw nsw i8 %op1, %op2
1299 ; CHECK: sub i8 %op1, %op2
1300 sub nuw i8 %op1, %op2
1301 ; CHECK: sub nuw i8 %op1, %op2
1302 sub nsw i8 %op1, %op2
1303 ; CHECK: sub nsw i8 %op1, %op2
1304 sub nuw nsw i8 %op1, %op2
1305 ; CHECK: sub nuw nsw i8 %op1, %op2
1307 ; CHECK: mul i8 %op1, %op2
1308 mul nuw i8 %op1, %op2
1309 ; CHECK: mul nuw i8 %op1, %op2
1310 mul nsw i8 %op1, %op2
1311 ; CHECK: mul nsw i8 %op1, %op2
1312 mul nuw nsw i8 %op1, %op2
1313 ; CHECK: mul nuw nsw i8 %op1, %op2
1317 ; CHECK: udiv i8 %op1, %op2
1318 udiv exact i8 %op1, %op2
1319 ; CHECK: udiv exact i8 %op1, %op2
1321 ; CHECK: sdiv i8 %op1, %op2
1322 sdiv exact i8 %op1, %op2
1323 ; CHECK: sdiv exact i8 %op1, %op2
1327 ; CHECK: urem i8 %op1, %op2
1329 ; CHECK: srem i8 %op1, %op2
1334 ; Instructions -- Bitwise Binary Operations
1335 define void @instructions.bitwise_binops(i8 %op1, i8 %op2) {
1338 ; CHECK: shl i8 %op1, %op2
1339 shl nuw i8 %op1, %op2
1340 ; CHECK: shl nuw i8 %op1, %op2
1341 shl nsw i8 %op1, %op2
1342 ; CHECK: shl nsw i8 %op1, %op2
1343 shl nuw nsw i8 %op1, %op2
1344 ; CHECK: shl nuw nsw i8 %op1, %op2
1348 ; CHECK: lshr i8 %op1, %op2
1349 lshr exact i8 %op1, %op2
1350 ; CHECK: lshr exact i8 %op1, %op2
1352 ; CHECK: ashr i8 %op1, %op2
1353 ashr exact i8 %op1, %op2
1354 ; CHECK: ashr exact i8 %op1, %op2
1358 ; CHECK: and i8 %op1, %op2
1360 ; CHECK: or i8 %op1, %op2
1362 ; CHECK: xor i8 %op1, %op2
1367 ; Instructions -- Vector Operations
1368 define void @instructions.vectorops(<4 x float> %vec, <4 x float> %vec2) {
1369 extractelement <4 x float> %vec, i8 0
1370 ; CHECK: extractelement <4 x float> %vec, i8 0
1371 insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1372 ; CHECK: insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1373 shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1374 ; CHECK: shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1379 ; Instructions -- Aggregate Operations
1380 define void @instructions.aggregateops({ i8, i32 } %up, <{ i8, i32 }> %p,
1381 [3 x i8] %arr, { i8, { i32 }} %n,
1382 <2 x ptr> %pvec, <2 x i64> %offsets) {
1383 extractvalue { i8, i32 } %up, 0
1384 ; CHECK: extractvalue { i8, i32 } %up, 0
1385 extractvalue <{ i8, i32 }> %p, 1
1386 ; CHECK: extractvalue <{ i8, i32 }> %p, 1
1387 extractvalue [3 x i8] %arr, 2
1388 ; CHECK: extractvalue [3 x i8] %arr, 2
1389 extractvalue { i8, { i32 } } %n, 1, 0
1390 ; CHECK: extractvalue { i8, { i32 } } %n, 1, 0
1392 insertvalue { i8, i32 } %up, i8 1, 0
1393 ; CHECK: insertvalue { i8, i32 } %up, i8 1, 0
1394 insertvalue <{ i8, i32 }> %p, i32 2, 1
1395 ; CHECK: insertvalue <{ i8, i32 }> %p, i32 2, 1
1396 insertvalue [3 x i8] %arr, i8 0, 0
1397 ; CHECK: insertvalue [3 x i8] %arr, i8 0, 0
1398 insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1399 ; CHECK: insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1401 %up.ptr = alloca { i8, i32 }
1402 %p.ptr = alloca <{ i8, i32 }>
1403 %arr.ptr = alloca [3 x i8]
1404 %n.ptr = alloca { i8, { i32 } }
1406 getelementptr { i8, i32 }, ptr %up.ptr, i8 0
1407 ; CHECK: getelementptr { i8, i32 }, ptr %up.ptr, i8 0
1408 getelementptr <{ i8, i32 }>, ptr %p.ptr, i8 1
1409 ; CHECK: getelementptr <{ i8, i32 }>, ptr %p.ptr, i8 1
1410 getelementptr [3 x i8], ptr %arr.ptr, i8 2
1411 ; CHECK: getelementptr [3 x i8], ptr %arr.ptr, i8 2
1412 getelementptr { i8, { i32 } }, ptr %n.ptr, i32 0, i32 1
1413 ; CHECK: getelementptr { i8, { i32 } }, ptr %n.ptr, i32 0, i32 1
1414 getelementptr inbounds { i8, { i32 } }, ptr %n.ptr, i32 1, i32 0
1415 ; CHECK: getelementptr inbounds { i8, { i32 } }, ptr %n.ptr, i32 1, i32 0
1416 getelementptr i8, <2 x ptr> %pvec, <2 x i64> %offsets
1417 ; CHECK: getelementptr i8, <2 x ptr> %pvec, <2 x i64> %offsets
1422 ; Instructions -- Memory Access and Addressing Operations
1426 define void @instructions.memops(ptr %base) {
1427 alloca i32, i8 4, align 4
1428 ; CHECK: alloca i32, i8 4, align 4
1429 alloca inalloca i32, i8 4, align 4
1430 ; CHECK: alloca inalloca i32, i8 4, align 4
1432 load ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !8, !dereferenceable !9, !dereferenceable_or_null !9
1433 ; CHECK: load ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !8, !dereferenceable !9, !dereferenceable_or_null !9
1434 load volatile ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !8, !dereferenceable !9, !dereferenceable_or_null !9
1435 ; CHECK: load volatile ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !8, !dereferenceable !9, !dereferenceable_or_null !9
1437 store ptr null, ptr %base, align 4, !nontemporal !8
1438 ; CHECK: store ptr null, ptr %base, align 4, !nontemporal !8
1439 store volatile ptr null, ptr %base, align 4, !nontemporal !8
1440 ; CHECK: store volatile ptr null, ptr %base, align 4, !nontemporal !8
1445 ; Instructions -- Conversion Operations
1446 define void @instructions.conversions() {
1448 ; CHECK: trunc i32 -1 to i1
1450 ; CHECK: zext i32 -1 to i64
1452 ; CHECK: sext i32 -1 to i64
1453 fptrunc float undef to half
1454 ; CHECK: fptrunc float undef to half
1455 fpext half undef to float
1456 ; CHECK: fpext half undef to float
1457 fptoui float undef to i32
1458 ; CHECK: fptoui float undef to i32
1459 fptosi float undef to i32
1460 ; CHECK: fptosi float undef to i32
1461 fptrunc float poison to half
1462 ; CHECK: fptrunc float poison to half
1463 fpext half poison to float
1464 ; CHECK: fpext half poison to float
1465 fptoui float poison to i32
1466 ; CHECK: fptoui float poison to i32
1467 fptosi float poison to i32
1468 ; CHECK: fptosi float poison to i32
1469 uitofp i32 1 to float
1470 ; CHECK: uitofp i32 1 to float
1471 sitofp i32 -1 to float
1472 ; CHECK: sitofp i32 -1 to float
1473 ptrtoint ptr null to i64
1474 ; CHECK: ptrtoint ptr null to i64
1475 inttoptr i64 0 to ptr
1476 ; CHECK: inttoptr i64 0 to ptr
1477 bitcast i32 0 to i32
1478 ; CHECK: bitcast i32 0 to i32
1479 addrspacecast ptr null to ptr addrspace(1)
1480 ; CHECK: addrspacecast ptr null to ptr addrspace(1)
1485 ; Instructions -- Other Operations
1486 define void @instructions.other(i32 %op1, i32 %op2, half %fop1, half %fop2, <2 x i32> %vop, ptr %pop) {
1488 icmp eq i32 %op1, %op2
1489 ; CHECK: icmp eq i32 %op1, %op2
1490 icmp ne i32 %op1, %op2
1491 ; CHECK: icmp ne i32 %op1, %op2
1492 icmp ugt i32 %op1, %op2
1493 ; CHECK: icmp ugt i32 %op1, %op2
1494 icmp uge i32 %op1, %op2
1495 ; CHECK: icmp uge i32 %op1, %op2
1496 icmp ult i32 %op1, %op2
1497 ; CHECK: icmp ult i32 %op1, %op2
1498 icmp ule i32 %op1, %op2
1499 ; CHECK: icmp ule i32 %op1, %op2
1500 icmp sgt i32 %op1, %op2
1501 ; CHECK: icmp sgt i32 %op1, %op2
1502 icmp sge i32 %op1, %op2
1503 ; CHECK: icmp sge i32 %op1, %op2
1504 icmp slt i32 %op1, %op2
1505 ; CHECK: icmp slt i32 %op1, %op2
1506 icmp sle i32 %op1, %op2
1507 ; CHECK: icmp sle i32 %op1, %op2
1509 fcmp false half %fop1, %fop2
1510 ; CHECK: fcmp false half %fop1, %fop2
1511 fcmp oeq half %fop1, %fop2
1512 ; CHECK: fcmp oeq half %fop1, %fop2
1513 fcmp ogt half %fop1, %fop2
1514 ; CHECK: fcmp ogt half %fop1, %fop2
1515 fcmp oge half %fop1, %fop2
1516 ; CHECK: fcmp oge half %fop1, %fop2
1517 fcmp olt half %fop1, %fop2
1518 ; CHECK: fcmp olt half %fop1, %fop2
1519 fcmp ole half %fop1, %fop2
1520 ; CHECK: fcmp ole half %fop1, %fop2
1521 fcmp one half %fop1, %fop2
1522 ; CHECK: fcmp one half %fop1, %fop2
1523 fcmp ord half %fop1, %fop2
1524 ; CHECK: fcmp ord half %fop1, %fop2
1525 fcmp ueq half %fop1, %fop2
1526 ; CHECK: fcmp ueq half %fop1, %fop2
1527 fcmp ugt half %fop1, %fop2
1528 ; CHECK: fcmp ugt half %fop1, %fop2
1529 fcmp uge half %fop1, %fop2
1530 ; CHECK: fcmp uge half %fop1, %fop2
1531 fcmp ult half %fop1, %fop2
1532 ; CHECK: fcmp ult half %fop1, %fop2
1533 fcmp ule half %fop1, %fop2
1534 ; CHECK: fcmp ule half %fop1, %fop2
1535 fcmp une half %fop1, %fop2
1536 ; CHECK: fcmp une half %fop1, %fop2
1537 fcmp uno half %fop1, %fop2
1538 ; CHECK: fcmp uno half %fop1, %fop2
1539 fcmp true half %fop1, %fop2
1540 ; CHECK: fcmp true half %fop1, %fop2
1544 %v1 = add i32 %op1, %op2
1547 %v2 = add i32 %op1, %op2
1550 phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1551 ; CHECK: phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1553 select i1 true, i32 0, i32 1
1554 ; CHECK: select i1 true, i32 0, i32 1
1555 select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1556 ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1558 call void @f.nobuiltin() builtin
1559 ; CHECK: call void @f.nobuiltin() #51
1561 call fastcc noalias ptr @f.noalias() noinline
1562 ; CHECK: call fastcc noalias ptr @f.noalias() #12
1563 tail call ghccc nonnull ptr @f.nonnull() minsize
1564 ; CHECK: tail call ghccc nonnull ptr @f.nonnull() #7
1567 ; CHECK: freeze i32 %op1
1569 ; CHECK: freeze i32 10
1571 ; CHECK: freeze half %fop1
1572 freeze <2 x i32> %vop
1573 ; CHECK: freeze <2 x i32> %vop
1575 ; CHECK: freeze ptr %pop
1579 define void @instructions.call_musttail(ptr inalloca(i8) %val) {
1580 musttail call void @f.param.inalloca(ptr inalloca(i8) %val)
1581 ; CHECK: musttail call void @f.param.inalloca(ptr inalloca(i8) %val)
1586 define void @instructions.call_notail() {
1587 notail call void @f1()
1588 ; CHECK: notail call void @f1()
1593 define void @instructions.landingpad() personality i32 -2 {
1594 invoke void @llvm.donothing() to label %proceed unwind label %catch1
1595 invoke void @llvm.donothing() to label %proceed unwind label %catch2
1596 invoke void @llvm.donothing() to label %proceed unwind label %catch3
1597 invoke void @llvm.donothing() to label %proceed unwind label %catch4
1601 ; CHECK: landingpad i32
1608 ; CHECK: landingpad i32
1612 ; CHECK: catch ptr null
1617 ; CHECK: landingpad i32
1621 ; CHECK: catch ptr null
1623 ; CHECK: catch ptr null
1628 ; CHECK: landingpad i32
1629 filter [2 x i32] zeroinitializer
1630 ; CHECK: filter [2 x i32] zeroinitializer
1637 ;; Intrinsic Functions
1639 ; Intrinsic Functions -- Variable Argument Handling
1640 declare void @llvm.va_start(ptr)
1641 declare void @llvm.va_copy(ptr, ptr)
1642 declare void @llvm.va_end(ptr)
1643 define void @instructions.va_arg(ptr %v, ...) {
1646 call void @llvm.va_start(ptr %ap)
1647 ; CHECK: call void @llvm.va_start(ptr %ap)
1650 ; CHECK: va_arg ptr %ap, i32
1652 call void @llvm.va_copy(ptr %v, ptr %ap)
1653 ; CHECK: call void @llvm.va_copy(ptr %v, ptr %ap)
1655 call void @llvm.va_end(ptr %ap)
1656 ; CHECK: call void @llvm.va_end(ptr %ap)
1661 ; Intrinsic Functions -- Accurate Garbage Collection
1662 declare void @llvm.gcroot(ptr, ptr)
1663 declare ptr @llvm.gcread(ptr, ptr)
1664 declare void @llvm.gcwrite(ptr, ptr, ptr)
1665 define void @intrinsics.gc() gc "shadow-stack" {
1666 %ptrloc = alloca ptr
1667 call void @llvm.gcroot(ptr %ptrloc, ptr null)
1668 ; CHECK: call void @llvm.gcroot(ptr %ptrloc, ptr null)
1670 call ptr @llvm.gcread(ptr null, ptr %ptrloc)
1671 ; CHECK: call ptr @llvm.gcread(ptr null, ptr %ptrloc)
1674 call void @llvm.gcwrite(ptr %ref, ptr null, ptr %ptrloc)
1675 ; CHECK: call void @llvm.gcwrite(ptr %ref, ptr null, ptr %ptrloc)
1680 ; Intrinsic Functions -- Code Generation
1681 declare ptr @llvm.returnaddress(i32)
1682 declare ptr @llvm.frameaddress(i32)
1683 declare i32 @llvm.read_register.i32(metadata)
1684 declare i64 @llvm.read_register.i64(metadata)
1685 declare void @llvm.write_register.i32(metadata, i32)
1686 declare void @llvm.write_register.i64(metadata, i64)
1687 declare ptr @llvm.stacksave()
1688 declare void @llvm.stackrestore(ptr)
1689 declare void @llvm.prefetch.p0(ptr, i32, i32, i32)
1690 declare void @llvm.pcmarker(i32)
1691 declare i64 @llvm.readcyclecounter()
1692 declare void @llvm.clear_cache(ptr, ptr)
1693 declare void @llvm.instrprof_increment(ptr, i64, i32, i32)
1696 define void @intrinsics.codegen() {
1697 call ptr @llvm.returnaddress(i32 1)
1698 ; CHECK: call ptr @llvm.returnaddress(i32 1)
1699 call ptr @llvm.frameaddress(i32 1)
1700 ; CHECK: call ptr @llvm.frameaddress.p0(i32 1)
1702 call i32 @llvm.read_register.i32(metadata !10)
1703 ; CHECK: call i32 @llvm.read_register.i32(metadata !10)
1704 call i64 @llvm.read_register.i64(metadata !10)
1705 ; CHECK: call i64 @llvm.read_register.i64(metadata !10)
1706 call void @llvm.write_register.i32(metadata !10, i32 0)
1707 ; CHECK: call void @llvm.write_register.i32(metadata !10, i32 0)
1708 call void @llvm.write_register.i64(metadata !10, i64 0)
1709 ; CHECK: call void @llvm.write_register.i64(metadata !10, i64 0)
1711 %stack = call ptr @llvm.stacksave()
1712 ; CHECK: %stack = call ptr @llvm.stacksave.p0()
1713 call void @llvm.stackrestore(ptr %stack)
1714 ; CHECK: call void @llvm.stackrestore.p0(ptr %stack)
1716 call void @llvm.prefetch.p0(ptr %stack, i32 0, i32 3, i32 0)
1717 ; CHECK: call void @llvm.prefetch.p0(ptr %stack, i32 0, i32 3, i32 0)
1719 call void @llvm.pcmarker(i32 1)
1720 ; CHECK: call void @llvm.pcmarker(i32 1)
1722 call i64 @llvm.readcyclecounter()
1723 ; CHECK: call i64 @llvm.readcyclecounter()
1725 call void @llvm.clear_cache(ptr null, ptr null)
1726 ; CHECK: call void @llvm.clear_cache(ptr null, ptr null)
1728 call void @llvm.instrprof_increment(ptr null, i64 0, i32 0, i32 0)
1729 ; CHECK: call void @llvm.instrprof_increment(ptr null, i64 0, i32 0, i32 0)
1734 declare void @llvm.localescape(...)
1735 declare ptr @llvm.localrecover(ptr %func, ptr %fp, i32 %idx)
1736 define void @intrinsics.localescape() {
1737 %static.alloca = alloca i32
1738 call void (...) @llvm.localescape(ptr %static.alloca)
1739 ; CHECK: call void (...) @llvm.localescape(ptr %static.alloca)
1741 call void @intrinsics.localrecover()
1745 define void @intrinsics.localrecover() {
1746 %fp = call ptr @llvm.frameaddress(i32 1)
1747 call ptr @llvm.localrecover(ptr @intrinsics.localescape, ptr %fp, i32 0)
1748 ; CHECK: call ptr @llvm.localrecover(ptr @intrinsics.localescape, ptr %fp, i32 0)
1753 ; We need this function to provide `uses' for some metadata tests.
1754 define void @misc.metadata() {
1755 call void @f1(), !srcloc !11
1756 call void @f1(), !srcloc !12
1757 call void @f1(), !srcloc !13
1758 call void @f1(), !srcloc !14
1762 declare void @op_bundle_callee_0()
1763 declare void @op_bundle_callee_1(i32,i32)
1765 define void @call_with_operand_bundle0(ptr %ptr) {
1766 ; CHECK-LABEL: call_with_operand_bundle0(
1768 %l = load i32, ptr %ptr
1770 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1771 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1775 define void @call_with_operand_bundle1(ptr %ptr) {
1776 ; CHECK-LABEL: call_with_operand_bundle1(
1778 %l = load i32, ptr %ptr
1781 call void @op_bundle_callee_0()
1782 call void @op_bundle_callee_0() [ "foo"() ]
1783 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1784 ; CHECK: @op_bundle_callee_0(){{$}}
1785 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"() ]
1786 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1790 define void @call_with_operand_bundle2(ptr %ptr) {
1791 ; CHECK-LABEL: call_with_operand_bundle2(
1793 call void @op_bundle_callee_0() [ "foo"() ]
1794 ; CHECK: call void @op_bundle_callee_0() [ "foo"() ]
1798 define void @call_with_operand_bundle3(ptr %ptr) {
1799 ; CHECK-LABEL: call_with_operand_bundle3(
1801 %l = load i32, ptr %ptr
1803 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1804 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1808 define void @call_with_operand_bundle4(ptr %ptr) {
1809 ; CHECK-LABEL: call_with_operand_bundle4(
1811 %l = load i32, ptr %ptr
1813 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) ]
1814 ; 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) ]
1818 ; Invoke versions of the above tests:
1821 define void @invoke_with_operand_bundle0(ptr %ptr) personality i8 3 {
1822 ; CHECK-LABEL: @invoke_with_operand_bundle0(
1824 %l = load i32, ptr %ptr
1826 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
1827 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1830 %cleanup = landingpad i8 cleanup
1836 define void @invoke_with_operand_bundle1(ptr %ptr) personality i8 3 {
1837 ; CHECK-LABEL: @invoke_with_operand_bundle1(
1839 %l = load i32, ptr %ptr
1842 invoke void @op_bundle_callee_0() to label %normal unwind label %exception
1843 ; CHECK: invoke void @op_bundle_callee_0(){{$}}
1846 %cleanup = landingpad i8 cleanup
1850 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal1 unwind label %exception1
1851 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1854 %cleanup1 = landingpad i8 cleanup
1858 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
1859 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1862 %cleanup2 = landingpad i8 cleanup
1869 define void @invoke_with_operand_bundle2(ptr %ptr) personality i8 3 {
1870 ; CHECK-LABEL: @invoke_with_operand_bundle2(
1872 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal unwind label %exception
1873 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1876 %cleanup = landingpad i8 cleanup
1882 define void @invoke_with_operand_bundle3(ptr %ptr) personality i8 3 {
1883 ; CHECK-LABEL: @invoke_with_operand_bundle3(
1885 %l = load i32, ptr %ptr
1887 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
1888 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1891 %cleanup = landingpad i8 cleanup
1897 define void @invoke_with_operand_bundle4(ptr %ptr) personality i8 3 {
1898 ; CHECK-LABEL: @invoke_with_operand_bundle4(
1900 %l = load i32, ptr %ptr
1902 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) ]
1903 to label %normal unwind label %exception
1904 ; 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) ]
1907 %cleanup = landingpad i8 cleanup
1913 declare void @vaargs_func(...)
1914 define void @invoke_with_operand_bundle_vaarg(ptr %ptr) personality i8 3 {
1915 ; CHECK-LABEL: @invoke_with_operand_bundle_vaarg(
1917 %l = load i32, ptr %ptr
1919 invoke void (...) @vaargs_func(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1920 to label %normal unwind label %exception
1921 ; 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) ]
1924 %cleanup = landingpad i8 cleanup
1931 declare void @f.writeonly() writeonly
1932 ; CHECK: declare void @f.writeonly() #42
1934 declare void @f.speculatable() speculatable
1935 ; CHECK: declare void @f.speculatable() #43
1937 ;; Constant Expressions
1939 define ptr @constexpr() {
1940 ; CHECK: ret ptr getelementptr inbounds ({ [4 x ptr], [4 x ptr] }, ptr null, i32 0, inrange i32 1, i32 2)
1941 ret ptr getelementptr inbounds ({ [4 x ptr], [4 x ptr] }, ptr null, i32 0, inrange i32 1, i32 2)
1944 define void @instructions.strictfp() strictfp {
1945 call void @f.strictfp() strictfp
1946 ; CHECK: call void @f.strictfp() #44
1951 declare void @f.nosanitize_coverage() nosanitize_coverage
1952 ; CHECK: declare void @f.nosanitize_coverage() #45
1954 declare void @f.disable_sanitizer_instrumentation() disable_sanitizer_instrumentation
1955 ; CHECK: declare void @f.disable_sanitizer_instrumentation() #46
1958 declare void @llvm.test.immarg.intrinsic(i32 immarg)
1959 ; CHECK: declare void @llvm.test.immarg.intrinsic(i32 immarg)
1961 ; byval attribute with type
1962 %named_type = type [8 x i8]
1963 declare void @byval_type(ptr byval(i32) align 2)
1964 declare void @byval_type2(ptr byval({ i8, ptr }))
1965 declare void @byval_named_type(ptr byval(%named_type))
1966 ; CHECK: declare void @byval_type(ptr byval(i32) align 2)
1967 ; CHECK: declare void @byval_type2(ptr byval({ i8, ptr }))
1968 ; CHECK: declare void @byval_named_type(ptr byval([8 x i8]))
1970 declare void @f.allocsize_one(i32) allocsize(0)
1971 declare void @f.allocsize_two(i32, i32) allocsize(1, 0)
1972 ; CHECK: Function Attrs: allocsize(0)
1973 ; CHECK: declare void @f.allocsize_one(i32)
1974 ; CHECK: Function Attrs: allocsize(1,0)
1975 ; CHECK: declare void @f.allocsize_two(i32, i32)
1977 declare void @f.nosanitize_bounds() nosanitize_bounds
1978 ; CHECK: declare void @f.nosanitize_bounds() #49
1980 declare void @f.allockind() allockind("alloc,uninitialized")
1981 ; CHECK: declare void @f.allockind() #50
1984 ; CHECK: declare nofpclass(snan) float @nofpclass_snan(float nofpclass(snan))
1985 declare nofpclass(snan) float @nofpclass_snan(float nofpclass(snan))
1987 ; CHECK: declare nofpclass(qnan) float @nofpclass_qnan(float nofpclass(qnan))
1988 declare nofpclass(qnan) float @nofpclass_qnan(float nofpclass(qnan))
1990 ; CHECK: declare nofpclass(ninf) float @nofpclass_ninf(float nofpclass(ninf))
1991 declare nofpclass(ninf) float @nofpclass_ninf(float nofpclass(ninf))
1993 ; CHECK: declare nofpclass(nnorm) float @nofpclass_nnorm(float nofpclass(nnorm))
1994 declare nofpclass(nnorm) float @nofpclass_nnorm(float nofpclass(nnorm))
1996 ; CHECK: declare nofpclass(nsub) float @nofpclass_nsub(float nofpclass(nsub))
1997 declare nofpclass(nsub) float @nofpclass_nsub(float nofpclass(nsub))
1999 ; CHECK: declare nofpclass(nzero) float @nofpclass_nzero(float nofpclass(nzero))
2000 declare nofpclass(nzero) float @nofpclass_nzero(float nofpclass(nzero))
2002 ; CHECK: declare nofpclass(pzero) float @nofpclass_pzero(float nofpclass(pzero))
2003 declare nofpclass(pzero) float @nofpclass_pzero(float nofpclass(pzero))
2005 ; CHECK: declare nofpclass(psub) float @nofpclass_psub(float nofpclass(psub))
2006 declare nofpclass(psub) float @nofpclass_psub(float nofpclass(psub))
2008 ; CHECK: declare nofpclass(pnorm) float @nofpclass_pnorm(float nofpclass(pnorm))
2009 declare nofpclass(pnorm) float @nofpclass_pnorm(float nofpclass(pnorm))
2011 ; CHECK: declare nofpclass(pinf) float @nofpclass_pinf(float nofpclass(pinf))
2012 declare nofpclass(pinf) float @nofpclass_pinf(float nofpclass(pinf))
2014 ; CHECK: declare nofpclass(nan) float @nofpclass_nan(float nofpclass(nan))
2015 declare nofpclass(nan) float @nofpclass_nan(float nofpclass(nan))
2017 ; CHECK: declare nofpclass(inf) float @nofpclass_inf(float nofpclass(inf))
2018 declare nofpclass(inf) float @nofpclass_inf(float nofpclass(inf))
2020 ; CHECK: declare nofpclass(norm) float @nofpclass_norm(float nofpclass(norm))
2021 declare nofpclass(norm) float @nofpclass_norm(float nofpclass(norm))
2023 ; CHECK: declare nofpclass(zero) float @nofpclass_zero(float nofpclass(zero))
2024 declare nofpclass(zero) float @nofpclass_zero(float nofpclass(zero))
2026 ; CHECK: declare nofpclass(sub) float @nofpclass_sub(float nofpclass(sub))
2027 declare nofpclass(sub) float @nofpclass_sub(float nofpclass(sub))
2029 ; CHECK: declare nofpclass(all) float @nofpclass_all(float nofpclass(all))
2030 declare nofpclass(all) float @nofpclass_all(float nofpclass(all))
2032 ; CHECK: declare nofpclass(zero sub) float @nofpclass_sub_zero(float nofpclass(zero sub))
2033 declare nofpclass(sub zero) float @nofpclass_sub_zero(float nofpclass(sub zero))
2035 ; CHECK: declare nofpclass(inf sub) float @nofpclass_sub_inf(float nofpclass(inf sub))
2036 declare nofpclass(sub inf) float @nofpclass_sub_inf(float nofpclass(sub inf))
2038 declare float @unknown_fpclass_func(float)
2040 define float @nofpclass_callsites(float %arg) {
2041 ; CHECK: %call0 = call nofpclass(nan) float @unknown_fpclass_func(float nofpclass(ninf) %arg)
2042 %call0 = call nofpclass(nan) float @unknown_fpclass_func(float nofpclass(ninf) %arg)
2044 ; CHECK: %call1 = call nofpclass(inf) float @unknown_fpclass_func(float nofpclass(inf) %arg)
2045 %call1 = call nofpclass(inf) float @unknown_fpclass_func(float nofpclass(inf) %arg)
2047 ; CHECK: %call2 = call nofpclass(zero) float @unknown_fpclass_func(float nofpclass(norm) %arg)
2048 %call2 = call nofpclass(zero) float @unknown_fpclass_func(float nofpclass(norm) %arg)
2049 %add0 = fadd float %call0, %call1
2050 %add1 = fadd float %add0, %call2
2054 ; CHECK: attributes #0 = { alignstack=4 }
2055 ; CHECK: attributes #1 = { alignstack=8 }
2056 ; CHECK: attributes #2 = { alwaysinline }
2057 ; CHECK: attributes #3 = { cold }
2058 ; CHECK: attributes #4 = { convergent }
2059 ; CHECK: attributes #5 = { inlinehint }
2060 ; CHECK: attributes #6 = { jumptable }
2061 ; CHECK: attributes #7 = { minsize }
2062 ; CHECK: attributes #8 = { naked }
2063 ; CHECK: attributes #9 = { nobuiltin }
2064 ; CHECK: attributes #10 = { noduplicate }
2065 ; CHECK: attributes #11 = { noimplicitfloat }
2066 ; CHECK: attributes #12 = { noinline }
2067 ; CHECK: attributes #13 = { nonlazybind }
2068 ; CHECK: attributes #14 = { noredzone }
2069 ; CHECK: attributes #15 = { noreturn }
2070 ; CHECK: attributes #16 = { nounwind }
2071 ; CHECK: attributes #17 = { noinline optnone }
2072 ; CHECK: attributes #18 = { optsize }
2073 ; CHECK: attributes #19 = { memory(none) }
2074 ; CHECK: attributes #20 = { memory(read) }
2075 ; CHECK: attributes #21 = { returns_twice }
2076 ; CHECK: attributes #22 = { safestack }
2077 ; CHECK: attributes #23 = { sanitize_address }
2078 ; CHECK: attributes #24 = { sanitize_memory }
2079 ; CHECK: attributes #25 = { sanitize_thread }
2080 ; CHECK: attributes #26 = { ssp }
2081 ; CHECK: attributes #27 = { sspreq }
2082 ; CHECK: attributes #28 = { sspstrong }
2083 ; CHECK: attributes #29 = { "thunk" }
2084 ; CHECK: attributes #30 = { uwtable }
2085 ; CHECK: attributes #31 = { "cpu"="cortex-a8" }
2086 ; CHECK: attributes #32 = { norecurse }
2087 ; CHECK: attributes #33 = { memory(inaccessiblemem: readwrite) }
2088 ; CHECK: attributes #34 = { memory(argmem: readwrite, inaccessiblemem: readwrite) }
2089 ; CHECK: attributes #35 = { nocallback nofree nosync nounwind willreturn memory(none) }
2090 ; CHECK: attributes #36 = { nocallback nofree nosync nounwind willreturn }
2091 ; CHECK: attributes #37 = { nounwind memory(argmem: read) }
2092 ; CHECK: attributes #38 = { nounwind memory(argmem: readwrite) }
2093 ; CHECK: attributes #39 = { nocallback nofree nosync nounwind willreturn memory(read) }
2094 ; CHECK: attributes #40 = { nocallback nounwind }
2095 ; CHECK: attributes #41 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
2096 ; CHECK: attributes #42 = { memory(write) }
2097 ; CHECK: attributes #43 = { speculatable }
2098 ; CHECK: attributes #44 = { strictfp }
2099 ; CHECK: attributes #45 = { nosanitize_coverage }
2100 ; CHECK: attributes #46 = { disable_sanitizer_instrumentation }
2101 ; CHECK: attributes #47 = { allocsize(0) }
2102 ; CHECK: attributes #48 = { allocsize(1,0) }
2103 ; CHECK: attributes #49 = { nosanitize_bounds }
2104 ; CHECK: attributes #50 = { allockind("alloc,uninitialized") }
2105 ; CHECK: attributes #51 = { builtin }
2109 ; Metadata -- Module flags
2110 !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
2111 ; CHECK: !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
2113 !0 = !{i32 1, !"mod1", i32 0}
2114 ; CHECK: !0 = !{i32 1, !"mod1", i32 0}
2115 !1 = !{i32 2, !"mod2", i32 0}
2116 ; CHECK: !1 = !{i32 2, !"mod2", i32 0}
2117 !2 = !{i32 3, !"mod3", !3}
2118 ; CHECK: !2 = !{i32 3, !"mod3", !3}
2120 ; CHECK: !3 = !{!"mod6", !0}
2121 !4 = !{i32 4, !"mod4", i32 0}
2122 ; CHECK: !4 = !{i32 4, !"mod4", i32 0}
2123 !5 = !{i32 5, !"mod5", !0}
2124 ; CHECK: !5 = !{i32 5, !"mod5", !0}
2125 !6 = !{i32 6, !"mod6", !0}
2126 ; CHECK: !6 = !{i32 6, !"mod6", !0}
2128 ; Metadata -- Check `distinct'
2130 ; CHECK: !11 = distinct !{}
2132 ; CHECK: !12 = distinct !{}
2134 ; CHECK: !13 = !{!11}
2136 ; CHECK: !14 = !{!12}