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 @auth_var = global ptr ptrauth (ptr @g1, i32 0, i64 65535, ptr null)
222 ; CHECK: @auth_var = global ptr ptrauth (ptr @g1, i32 0, i64 65535)
225 ; Format: @<Name> = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
226 ; [unnamed_addr] alias <AliaseeTy> @<Aliasee>
229 @a.private = private alias i32, ptr @g.private
230 ; CHECK: @a.private = private alias i32, ptr @g.private
231 @a.internal = internal alias i32, ptr @g.internal
232 ; CHECK: @a.internal = internal alias i32, ptr @g.internal
233 @a.linkonce = linkonce alias i32, ptr @g.linkonce
234 ; CHECK: @a.linkonce = linkonce alias i32, ptr @g.linkonce
235 @a.weak = weak alias i32, ptr @g.weak
236 ; CHECK: @a.weak = weak alias i32, ptr @g.weak
237 @a.linkonce_odr = linkonce_odr alias i32, ptr @g.linkonce_odr
238 ; CHECK: @a.linkonce_odr = linkonce_odr alias i32, ptr @g.linkonce_odr
239 @a.weak_odr = weak_odr alias i32, ptr @g.weak_odr
240 ; CHECK: @a.weak_odr = weak_odr alias i32, ptr @g.weak_odr
241 @a.external = external alias i32, ptr @g1
242 ; CHECK: @a.external = alias i32, ptr @g1
244 ; Aliases -- Visibility
245 @a.default = default alias i32, ptr @g.default
246 ; CHECK: @a.default = alias i32, ptr @g.default
247 @a.hidden = hidden alias i32, ptr @g.hidden
248 ; CHECK: @a.hidden = hidden alias i32, ptr @g.hidden
249 @a.protected = protected alias i32, ptr @g.protected
250 ; CHECK: @a.protected = protected alias i32, ptr @g.protected
252 ; Aliases -- DLLStorageClass
253 @a.dlldefault = default alias i32, ptr @g.dlldefault
254 ; CHECK: @a.dlldefault = alias i32, ptr @g.dlldefault
255 @a.dllexport = dllexport alias i32, ptr @g.dllexport
256 ; CHECK: @a.dllexport = dllexport alias i32, ptr @g.dllexport
258 ; Aliases -- ThreadLocal
259 @a.notthreadlocal = alias i32, ptr @g.notthreadlocal
260 ; CHECK: @a.notthreadlocal = alias i32, ptr @g.notthreadlocal
261 @a.generaldynamic = thread_local alias i32, ptr @g.generaldynamic
262 ; CHECK: @a.generaldynamic = thread_local alias i32, ptr @g.generaldynamic
263 @a.localdynamic = thread_local(localdynamic) alias i32, ptr @g.localdynamic
264 ; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, ptr @g.localdynamic
265 @a.initialexec = thread_local(initialexec) alias i32, ptr @g.initialexec
266 ; CHECK: @a.initialexec = thread_local(initialexec) alias i32, ptr @g.initialexec
267 @a.localexec = thread_local(localexec) alias i32, ptr @g.localexec
268 ; CHECK: @a.localexec = thread_local(localexec) alias i32, ptr @g.localexec
270 ; Aliases -- unnamed_addr and local_unnamed_addr
271 @a.unnamed_addr = unnamed_addr alias i32, ptr @g.unnamed_addr
272 ; CHECK: @a.unnamed_addr = unnamed_addr alias i32, ptr @g.unnamed_addr
273 @a.local_unnamed_addr = local_unnamed_addr alias i32, ptr @g.local_unnamed_addr
274 ; CHECK: @a.local_unnamed_addr = local_unnamed_addr alias i32, ptr @g.local_unnamed_addr
276 ; Aliases -- partition
277 ; CHECK: @alias.partition = alias i32, ptr @g.partition, partition "part"
278 @alias.partition = alias i32, ptr @g.partition, partition "part"
281 ; Format @<Name> = [Linkage] [Visibility] ifunc <IFuncTy>,
285 @ifunc.external = external ifunc void (), ptr @ifunc_resolver
286 ; CHECK: @ifunc.external = ifunc void (), ptr @ifunc_resolver
287 @ifunc.private = private ifunc void (), ptr @ifunc_resolver
288 ; CHECK: @ifunc.private = private ifunc void (), ptr @ifunc_resolver
289 @ifunc.internal = internal ifunc void (), ptr @ifunc_resolver
290 ; CHECK: @ifunc.internal = internal ifunc void (), ptr @ifunc_resolver
292 ; IFunc -- Visibility
293 @ifunc.default = default ifunc void (), ptr @ifunc_resolver
294 ; CHECK: @ifunc.default = ifunc void (), ptr @ifunc_resolver
295 @ifunc.hidden = hidden ifunc void (), ptr @ifunc_resolver
296 ; CHECK: @ifunc.hidden = hidden ifunc void (), ptr @ifunc_resolver
297 @ifunc.protected = protected ifunc void (), ptr @ifunc_resolver
298 ; CHECK: @ifunc.protected = protected ifunc void (), ptr @ifunc_resolver
301 ; CHECK: @ifunc.partition = ifunc void (), ptr @ifunc_resolver, partition "part"
302 @ifunc.partition = ifunc void (), ptr @ifunc_resolver, partition "part"
304 define ptr @ifunc_resolver() {
310 ; Format: define [linkage] [visibility] [DLLStorageClass]
311 ; [cconv] [ret attrs]
312 ; <ResultType> @<FunctionName> ([argument list])
313 ; [(unnamed_addr|local_unnamed_addr)] [fn Attrs] [section "name"] [comdat [($name)]]
314 ; [align N] [gc] [prefix Constant] [prologue Constant]
315 ; [personality Constant] { ... }
317 ; Functions -- Simple
319 ; CHECK: declare void @f1()
322 ; CHECK: define void @f2()
327 ; Functions -- linkage
328 define private void @f.private() {
329 ; CHECK: define private void @f.private()
333 define internal void @f.internal() {
334 ; CHECK: define internal void @f.internal()
338 define available_externally void @f.available_externally() {
339 ; CHECK: define available_externally void @f.available_externally()
343 define linkonce void @f.linkonce() {
344 ; CHECK: define linkonce void @f.linkonce()
348 define weak void @f.weak() {
349 ; CHECK: define weak void @f.weak()
353 define linkonce_odr void @f.linkonce_odr() {
354 ; CHECK: define linkonce_odr void @f.linkonce_odr()
358 define weak_odr void @f.weak_odr() {
359 ; CHECK: define weak_odr void @f.weak_odr()
363 declare external void @f.external()
364 ; CHECK: declare void @f.external()
365 declare extern_weak void @f.extern_weak()
366 ; CHECK: declare extern_weak void @f.extern_weak()
368 ; Functions -- visibility
369 declare default void @f.default()
370 ; CHECK: declare void @f.default()
371 declare hidden void @f.hidden()
372 ; CHECK: declare hidden void @f.hidden()
373 declare protected void @f.protected()
374 ; CHECK: declare protected void @f.protected()
376 ; Functions -- DLLStorageClass
377 declare dllimport void @f.dllimport()
378 ; CHECK: declare dllimport void @f.dllimport()
379 declare dllexport void @f.dllexport()
380 ; CHECK: declare dllexport void @f.dllexport()
382 ; Functions -- cconv (Calling conventions)
383 declare ccc void @f.ccc()
384 ; CHECK: declare void @f.ccc()
385 declare fastcc void @f.fastcc()
386 ; CHECK: declare fastcc void @f.fastcc()
387 declare coldcc void @f.coldcc()
388 ; CHECK: declare coldcc void @f.coldcc()
389 declare cc10 void @f.cc10()
390 ; CHECK: declare ghccc void @f.cc10()
391 declare ghccc void @f.ghccc()
392 ; CHECK: declare ghccc void @f.ghccc()
393 declare cc11 void @f.cc11()
394 ; CHECK: declare cc11 void @f.cc11()
395 declare anyregcc void @f.anyregcc()
396 ; CHECK: declare anyregcc void @f.anyregcc()
397 declare preserve_mostcc void @f.preserve_mostcc()
398 ; CHECK: declare preserve_mostcc void @f.preserve_mostcc()
399 declare preserve_allcc void @f.preserve_allcc()
400 ; CHECK: declare preserve_allcc void @f.preserve_allcc()
401 declare preserve_nonecc void @f.preserve_nonecc()
402 ; CHECK: declare preserve_nonecc void @f.preserve_nonecc()
403 declare swifttailcc void @f.swifttailcc()
404 ; CHECK: declare swifttailcc void @f.swifttailcc()
405 declare cc64 void @f.cc64()
406 ; CHECK: declare x86_stdcallcc void @f.cc64()
407 declare x86_stdcallcc void @f.x86_stdcallcc()
408 ; CHECK: declare x86_stdcallcc void @f.x86_stdcallcc()
409 declare cc65 void @f.cc65()
410 ; CHECK: declare x86_fastcallcc void @f.cc65()
411 declare x86_fastcallcc void @f.x86_fastcallcc()
412 ; CHECK: declare x86_fastcallcc void @f.x86_fastcallcc()
413 declare cc66 void @f.cc66()
414 ; CHECK: declare arm_apcscc void @f.cc66()
415 declare arm_apcscc void @f.arm_apcscc()
416 ; CHECK: declare arm_apcscc void @f.arm_apcscc()
417 declare cc67 void @f.cc67()
418 ; CHECK: declare arm_aapcscc void @f.cc67()
419 declare arm_aapcscc void @f.arm_aapcscc()
420 ; CHECK: declare arm_aapcscc void @f.arm_aapcscc()
421 declare cc68 void @f.cc68()
422 ; CHECK: declare arm_aapcs_vfpcc void @f.cc68()
423 declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
424 ; CHECK: declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
425 declare cc69 void @f.cc69()
426 ; CHECK: declare msp430_intrcc void @f.cc69()
427 declare msp430_intrcc void @f.msp430_intrcc()
428 ; CHECK: declare msp430_intrcc void @f.msp430_intrcc()
429 declare cc70 void @f.cc70()
430 ; CHECK: declare x86_thiscallcc void @f.cc70()
431 declare x86_thiscallcc void @f.x86_thiscallcc()
432 ; CHECK: declare x86_thiscallcc void @f.x86_thiscallcc()
433 declare cc71 void @f.cc71()
434 ; CHECK: declare ptx_kernel void @f.cc71()
435 declare ptx_kernel void @f.ptx_kernel()
436 ; CHECK: declare ptx_kernel void @f.ptx_kernel()
437 declare cc72 void @f.cc72()
438 ; CHECK: declare ptx_device void @f.cc72()
439 declare ptx_device void @f.ptx_device()
440 ; CHECK: declare ptx_device void @f.ptx_device()
441 declare cc75 void @f.cc75()
442 ; CHECK: declare spir_func void @f.cc75()
443 declare spir_func void @f.spir_func()
444 ; CHECK: declare spir_func void @f.spir_func()
445 declare cc76 void @f.cc76()
446 ; CHECK: declare spir_kernel void @f.cc76()
447 declare spir_kernel void @f.spir_kernel()
448 ; CHECK: declare spir_kernel void @f.spir_kernel()
449 declare cc77 void @f.cc77()
450 ; CHECK: declare intel_ocl_bicc void @f.cc77()
451 declare intel_ocl_bicc void @f.intel_ocl_bicc()
452 ; CHECK: declare intel_ocl_bicc void @f.intel_ocl_bicc()
453 declare cc78 void @f.cc78()
454 ; CHECK: declare x86_64_sysvcc void @f.cc78()
455 declare x86_64_sysvcc void @f.x86_64_sysvcc()
456 ; CHECK: declare x86_64_sysvcc void @f.x86_64_sysvcc()
457 declare cc79 void @f.cc79()
458 ; CHECK: declare win64cc void @f.cc79()
459 declare win64cc void @f.win64cc()
460 ; CHECK: declare win64cc void @f.win64cc()
461 declare cc80 void @f.cc80()
462 ; CHECK: declare x86_vectorcallcc void @f.cc80()
463 declare x86_vectorcallcc void @f.x86_vectorcallcc()
464 ; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc()
465 declare cc81 void @f.cc81()
466 ; CHECK: declare hhvmcc void @f.cc81()
467 declare hhvmcc void @f.hhvmcc()
468 ; CHECK: declare hhvmcc void @f.hhvmcc()
469 declare cc82 void @f.cc82()
470 ; CHECK: declare hhvm_ccc void @f.cc82()
471 declare hhvm_ccc void @f.hhvm_ccc()
472 ; CHECK: declare hhvm_ccc void @f.hhvm_ccc()
473 declare cc83 void @f.cc83(ptr byval(i8))
474 ; CHECK: declare x86_intrcc void @f.cc83(ptr byval(i8))
475 declare x86_intrcc void @f.x86_intrcc(ptr byval(i8))
476 ; CHECK: declare x86_intrcc void @f.x86_intrcc(ptr byval(i8))
477 declare cc84 void @f.cc84()
478 ; CHECK: declare avr_intrcc void @f.cc84()
479 declare avr_intrcc void @f.avr_intrcc()
480 ; CHECK: declare avr_intrcc void @f.avr_intrcc()
481 declare cc85 void @f.cc85()
482 ; CHECK: declare avr_signalcc void @f.cc85()
483 declare avr_signalcc void @f.avr_signalcc()
484 ; CHECK: declare avr_signalcc void @f.avr_signalcc()
485 declare cc87 void @f.cc87()
486 ; CHECK: declare amdgpu_vs void @f.cc87()
487 declare amdgpu_vs void @f.amdgpu_vs()
488 ; CHECK: declare amdgpu_vs void @f.amdgpu_vs()
489 declare cc88 void @f.cc88()
490 ; CHECK: declare amdgpu_gs void @f.cc88()
491 declare amdgpu_gs void @f.amdgpu_gs()
492 ; CHECK: declare amdgpu_gs void @f.amdgpu_gs()
493 declare cc89 void @f.cc89()
494 ; CHECK: declare amdgpu_ps void @f.cc89()
495 declare amdgpu_ps void @f.amdgpu_ps()
496 ; CHECK: declare amdgpu_ps void @f.amdgpu_ps()
497 declare cc90 void @f.cc90()
498 ; CHECK: declare amdgpu_cs void @f.cc90()
499 declare amdgpu_cs void @f.amdgpu_cs()
500 ; CHECK: declare amdgpu_cs void @f.amdgpu_cs()
501 declare amdgpu_gfx void @f.amdgpu_gfx()
502 ; CHECK: declare amdgpu_gfx void @f.amdgpu_gfx()
503 declare cc91 void @f.cc91()
504 ; CHECK: declare amdgpu_kernel void @f.cc91()
505 declare amdgpu_kernel void @f.amdgpu_kernel()
506 ; CHECK: declare amdgpu_kernel void @f.amdgpu_kernel()
507 declare cc93 void @f.cc93()
508 ; CHECK: declare amdgpu_hs void @f.cc93()
509 declare amdgpu_hs void @f.amdgpu_hs()
510 ; CHECK: declare amdgpu_hs void @f.amdgpu_hs()
511 declare cc95 void @f.cc95()
512 ; CHECK: declare amdgpu_ls void @f.cc95()
513 declare amdgpu_ls void @f.amdgpu_ls()
514 ; CHECK: declare amdgpu_ls void @f.amdgpu_ls()
515 declare cc96 void @f.cc96()
516 ; CHECK: declare amdgpu_es void @f.cc96()
517 declare amdgpu_es void @f.amdgpu_es()
518 ; CHECK: declare amdgpu_es void @f.amdgpu_es()
519 declare cc1023 void @f.cc1023()
520 ; CHECK: declare cc1023 void @f.cc1023()
522 ; Functions -- ret attrs (Return attributes)
523 declare zeroext i64 @f.zeroext()
524 ; CHECK: declare zeroext i64 @f.zeroext()
525 declare signext i64 @f.signext()
526 ; CHECK: declare signext i64 @f.signext()
527 declare inreg ptr @f.inreg()
528 ; CHECK: declare inreg ptr @f.inreg()
529 declare noalias ptr @f.noalias()
530 ; CHECK: declare noalias ptr @f.noalias()
531 declare nonnull ptr @f.nonnull()
532 ; CHECK: declare nonnull ptr @f.nonnull()
533 declare dereferenceable(4) ptr @f.dereferenceable4()
534 ; CHECK: declare dereferenceable(4) ptr @f.dereferenceable4()
535 declare dereferenceable(8) ptr @f.dereferenceable8()
536 ; CHECK: declare dereferenceable(8) ptr @f.dereferenceable8()
537 declare dereferenceable(16) ptr @f.dereferenceable16()
538 ; CHECK: declare dereferenceable(16) ptr @f.dereferenceable16()
539 declare dereferenceable_or_null(4) ptr @f.dereferenceable4_or_null()
540 ; CHECK: declare dereferenceable_or_null(4) ptr @f.dereferenceable4_or_null()
541 declare dereferenceable_or_null(8) ptr @f.dereferenceable8_or_null()
542 ; CHECK: declare dereferenceable_or_null(8) ptr @f.dereferenceable8_or_null()
543 declare dereferenceable_or_null(16) ptr @f.dereferenceable16_or_null()
544 ; CHECK: declare dereferenceable_or_null(16) ptr @f.dereferenceable16_or_null()
546 ; Functions -- Parameter attributes
547 declare void @f.param.zeroext(i8 zeroext)
548 ; CHECK: declare void @f.param.zeroext(i8 zeroext)
549 declare void @f.param.signext(i8 signext)
550 ; CHECK: declare void @f.param.signext(i8 signext)
551 declare void @f.param.inreg(i8 inreg)
552 ; CHECK: declare void @f.param.inreg(i8 inreg)
553 declare void @f.param.byval(ptr byval({ i8, i8 }))
554 ; CHECK: declare void @f.param.byval(ptr byval({ i8, i8 }))
555 declare void @f.param.inalloca(ptr inalloca(i8))
556 ; CHECK: declare void @f.param.inalloca(ptr inalloca(i8))
557 declare void @f.param.sret(ptr sret(i8))
558 ; CHECK: declare void @f.param.sret(ptr sret(i8))
559 declare void @f.param.noalias(ptr noalias)
560 ; CHECK: declare void @f.param.noalias(ptr noalias)
561 declare void @f.param.nocapture(ptr nocapture)
562 ; CHECK: declare void @f.param.nocapture(ptr nocapture)
563 declare void @f.param.nest(ptr nest)
564 ; CHECK: declare void @f.param.nest(ptr nest)
565 declare ptr @f.param.returned(ptr returned)
566 ; CHECK: declare ptr @f.param.returned(ptr returned)
567 declare void @f.param.nonnull(ptr nonnull)
568 ; CHECK: declare void @f.param.nonnull(ptr nonnull)
569 declare void @f.param.dereferenceable(ptr dereferenceable(4))
570 ; CHECK: declare void @f.param.dereferenceable(ptr dereferenceable(4))
571 declare void @f.param.dereferenceable_or_null(ptr dereferenceable_or_null(4))
572 ; CHECK: declare void @f.param.dereferenceable_or_null(ptr dereferenceable_or_null(4))
573 declare void @f.param.stack_align([2 x double] alignstack(16))
574 ; CHECK: declare void @f.param.stack_align([2 x double] alignstack(16))
575 declare void @f.param.swiftself(ptr swiftself)
576 ; CHECK: declare void @f.param.swiftself(ptr swiftself)
577 declare void @f.param.swiftasync(ptr swiftasync)
578 ; CHECK: declare void @f.param.swiftasync(ptr swiftasync)
579 declare void @f.param.swifterror(ptr swifterror)
580 ; CHECK: declare void @f.param.swifterror(ptr swifterror)
581 declare void @f.param.allocalign(i32 allocalign)
582 ; CHECK: declare void @f.param.allocalign(i32 allocalign)
583 declare void @f.param.allocptr(ptr allocptr)
584 ; CHECK: declare void @f.param.allocptr(ptr allocptr)
586 ; Functions -- unnamed_addr and local_unnamed_addr
587 declare void @f.unnamed_addr() unnamed_addr
588 ; CHECK: declare void @f.unnamed_addr() unnamed_addr
589 declare void @f.local_unnamed_addr() local_unnamed_addr
590 ; CHECK: declare void @f.local_unnamed_addr() local_unnamed_addr
592 ; Functions -- fn Attrs (Function attributes)
593 declare void @f.alignstack4() alignstack(4)
594 ; CHECK: declare void @f.alignstack4() #0
595 declare void @f.alignstack8() alignstack(8)
596 ; CHECK: declare void @f.alignstack8() #1
597 declare void @f.alwaysinline() alwaysinline
598 ; CHECK: declare void @f.alwaysinline() #2
599 declare void @f.cold() cold
600 ; CHECK: declare void @f.cold() #3
601 declare void @f.convergent() convergent
602 ; CHECK: declare void @f.convergent() #4
603 declare void @f.inlinehint() inlinehint
604 ; CHECK: declare void @f.inlinehint() #5
605 declare void @f.jumptable() unnamed_addr jumptable
606 ; CHECK: declare void @f.jumptable() unnamed_addr #6
607 declare void @f.minsize() minsize
608 ; CHECK: declare void @f.minsize() #7
609 declare void @f.naked() naked
610 ; CHECK: declare void @f.naked() #8
611 declare void @f.nobuiltin() nobuiltin
612 ; CHECK: declare void @f.nobuiltin() #9
613 declare void @f.noduplicate() noduplicate
614 ; CHECK: declare void @f.noduplicate() #10
615 declare void @f.noimplicitfloat() noimplicitfloat
616 ; CHECK: declare void @f.noimplicitfloat() #11
617 declare void @f.noinline() noinline
618 ; CHECK: declare void @f.noinline() #12
619 declare void @f.nonlazybind() nonlazybind
620 ; CHECK: declare void @f.nonlazybind() #13
621 declare void @f.noredzone() noredzone
622 ; CHECK: declare void @f.noredzone() #14
623 declare void @f.noreturn() noreturn
624 ; CHECK: declare void @f.noreturn() #15
625 declare void @f.nounwind() nounwind
626 ; CHECK: declare void @f.nounwind() #16
627 declare void @f.optnone() noinline optnone
628 ; CHECK: declare void @f.optnone() #17
629 declare void @f.optsize() optsize
630 ; CHECK: declare void @f.optsize() #18
631 declare void @f.readnone() readnone
632 ; CHECK: declare void @f.readnone() #19
633 declare void @f.readonly() readonly
634 ; CHECK: declare void @f.readonly() #20
635 declare void @f.returns_twice() returns_twice
636 ; CHECK: declare void @f.returns_twice() #21
637 declare void @f.safestack() safestack
638 ; CHECK: declare void @f.safestack() #22
639 declare void @f.sanitize_address() sanitize_address
640 ; CHECK: declare void @f.sanitize_address() #23
641 declare void @f.sanitize_memory() sanitize_memory
642 ; CHECK: declare void @f.sanitize_memory() #24
643 declare void @f.sanitize_thread() sanitize_thread
644 ; CHECK: declare void @f.sanitize_thread() #25
645 declare void @f.ssp() ssp
646 ; CHECK: declare void @f.ssp() #26
647 declare void @f.sspreq() sspreq
648 ; CHECK: declare void @f.sspreq() #27
649 declare void @f.sspstrong() sspstrong
650 ; CHECK: declare void @f.sspstrong() #28
651 declare void @f.thunk() "thunk"
652 ; CHECK: declare void @f.thunk() #29
653 declare void @f.uwtable() uwtable
654 ; CHECK: declare void @f.uwtable() #30
655 declare void @f.kvpair() "cpu"="cortex-a8"
656 ; CHECK:declare void @f.kvpair() #31
657 declare void @f.norecurse() norecurse
658 ; CHECK: declare void @f.norecurse() #32
659 declare void @f.inaccessiblememonly() inaccessiblememonly
660 ; CHECK: declare void @f.inaccessiblememonly() #33
661 declare void @f.inaccessiblemem_or_argmemonly() inaccessiblemem_or_argmemonly
662 ; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #34
663 declare void @f.strictfp() #35
665 ; Functions -- section
666 declare void @f.section() section "80"
667 ; CHECK: declare void @f.section() section "80"
669 ; Functions -- partition
670 define void @f.partition() partition "part" {
671 ; CHECK: define void @f.partition() partition "part"
675 ; Functions -- comdat
676 define void @f.comdat_any() comdat($comdat.any) {
677 ; CHECK: define void @f.comdat_any() comdat($comdat.any)
681 define void @f.comdat_exactmatch() comdat($comdat.exactmatch) {
682 ; CHECK: define void @f.comdat_exactmatch() comdat($comdat.exactmatch)
686 define void @f.comdat_largest() comdat($comdat.largest) {
687 ; CHECK: define void @f.comdat_largest() comdat($comdat.largest)
691 define void @f.comdat_noduplicates() comdat($comdat.noduplicates) {
692 ; CHECK: define void @f.comdat_noduplicates() comdat($comdat.noduplicates)
696 define void @f.comdat_samesize() comdat($comdat.samesize) {
697 ; CHECK: define void @f.comdat_samesize() comdat($comdat.samesize)
703 declare void @f.align2() align 2
704 ; CHECK: declare void @f.align2() align 2
705 declare void @f.align4() align 4
706 ; CHECK: declare void @f.align4() align 4
707 declare void @f.align8() align 8
708 ; CHECK: declare void @f.align8() align 8
711 declare void @f.gcshadow() gc "shadow-stack"
712 ; CHECK: declare void @f.gcshadow() gc "shadow-stack"
714 ; Functions -- Prefix data
715 declare void @f.prefixi32() prefix i32 1684365668
716 ; CHECK: declare void @f.prefixi32() prefix i32 1684365668
717 declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
718 ; CHECK: declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
720 ; Functions -- Prologue data
721 declare void @f.prologuei32() prologue i32 1684365669
722 ; CHECK: declare void @f.prologuei32() prologue i32 1684365669
723 declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
724 ; CHECK: declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
726 ; Functions -- Personality constant
727 declare void @llvm.donothing() nounwind readnone
728 ; CHECK: declare void @llvm.donothing() #35
729 define void @f.no_personality() personality i8 3 {
730 ; CHECK: define void @f.no_personality() personality i8 3
731 invoke void @llvm.donothing() to label %normal unwind label %exception
733 %cleanup = landingpad i8 cleanup
739 declare i32 @f.personality_handler()
740 ; CHECK: declare i32 @f.personality_handler()
741 define void @f.personality() personality ptr @f.personality_handler {
742 ; CHECK: define void @f.personality() personality ptr @f.personality_handler
743 invoke void @llvm.donothing() to label %normal unwind label %exception
745 %cleanup = landingpad i32 cleanup
751 ;; Atomic Memory Ordering Constraints
752 define void @atomics(ptr %word) {
753 ;; Atomic Compare And Exchange w/o alignment
754 %cmpxchg_no_align.0 = cmpxchg ptr %word, i32 0, i32 4 monotonic monotonic
755 ; CHECK: %cmpxchg_no_align.0 = cmpxchg ptr %word, i32 0, i32 4 monotonic monotonic
756 %cmpxchg_no_align.1 = cmpxchg ptr %word, i32 0, i32 5 acq_rel monotonic
757 ; CHECK: %cmpxchg_no_align.1 = cmpxchg ptr %word, i32 0, i32 5 acq_rel monotonic
758 %cmpxchg_no_align.2 = cmpxchg ptr %word, i32 0, i32 6 acquire monotonic
759 ; CHECK: %cmpxchg_no_align.2 = cmpxchg ptr %word, i32 0, i32 6 acquire monotonic
760 %cmpxchg_no_align.3 = cmpxchg ptr %word, i32 0, i32 7 release monotonic
761 ; CHECK: %cmpxchg_no_align.3 = cmpxchg ptr %word, i32 0, i32 7 release monotonic
762 %cmpxchg_no_align.4 = cmpxchg ptr %word, i32 0, i32 8 seq_cst monotonic
763 ; CHECK: %cmpxchg_no_align.4 = cmpxchg ptr %word, i32 0, i32 8 seq_cst monotonic
764 %cmpxchg_no_align.5 = cmpxchg weak ptr %word, i32 0, i32 9 seq_cst monotonic
765 ; CHECK: %cmpxchg_no_align.5 = cmpxchg weak ptr %word, i32 0, i32 9 seq_cst monotonic
766 %cmpxchg_no_align.6 = cmpxchg volatile ptr %word, i32 0, i32 10 seq_cst monotonic
767 ; CHECK: %cmpxchg_no_align.6 = cmpxchg volatile ptr %word, i32 0, i32 10 seq_cst monotonic
768 %cmpxchg_no_align.7 = cmpxchg weak volatile ptr %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
769 ; CHECK: %cmpxchg_no_align.7 = cmpxchg weak volatile ptr %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
771 ;; Atomic Compare And Exchange w/ alignment
772 %cmpxchg.0 = cmpxchg ptr %word, i32 0, i32 4 monotonic monotonic, align 16
773 ; CHECK: %cmpxchg.0 = cmpxchg ptr %word, i32 0, i32 4 monotonic monotonic, align 16
774 %cmpxchg.1 = cmpxchg ptr %word, i32 0, i32 5 acq_rel monotonic, align 16
775 ; CHECK: %cmpxchg.1 = cmpxchg ptr %word, i32 0, i32 5 acq_rel monotonic, align 16
776 %cmpxchg.2 = cmpxchg ptr %word, i32 0, i32 6 acquire monotonic, align 16
777 ; CHECK: %cmpxchg.2 = cmpxchg ptr %word, i32 0, i32 6 acquire monotonic, align 16
778 %cmpxchg.3 = cmpxchg ptr %word, i32 0, i32 7 release monotonic, align 16
779 ; CHECK: %cmpxchg.3 = cmpxchg ptr %word, i32 0, i32 7 release monotonic, align 16
780 %cmpxchg.4 = cmpxchg ptr %word, i32 0, i32 8 seq_cst monotonic, align 16
781 ; CHECK: %cmpxchg.4 = cmpxchg ptr %word, i32 0, i32 8 seq_cst monotonic, align 16
782 %cmpxchg.5 = cmpxchg weak ptr %word, i32 0, i32 9 seq_cst monotonic, align 16
783 ; CHECK: %cmpxchg.5 = cmpxchg weak ptr %word, i32 0, i32 9 seq_cst monotonic, align 16
784 %cmpxchg.6 = cmpxchg volatile ptr %word, i32 0, i32 10 seq_cst monotonic, align 16
785 ; CHECK: %cmpxchg.6 = cmpxchg volatile ptr %word, i32 0, i32 10 seq_cst monotonic, align 16
786 %cmpxchg.7 = cmpxchg weak volatile ptr %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic, align 16
787 ; CHECK: %cmpxchg.7 = cmpxchg weak volatile ptr %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic, align 16
789 ;; Atomic w/o alignment
790 %atomicrmw_no_align.xchg = atomicrmw xchg ptr %word, i32 12 monotonic
791 ; CHECK: %atomicrmw_no_align.xchg = atomicrmw xchg ptr %word, i32 12 monotonic
792 %atomicrmw_no_align.add = atomicrmw add ptr %word, i32 13 monotonic
793 ; CHECK: %atomicrmw_no_align.add = atomicrmw add ptr %word, i32 13 monotonic
794 %atomicrmw_no_align.sub = atomicrmw sub ptr %word, i32 14 monotonic
795 ; CHECK: %atomicrmw_no_align.sub = atomicrmw sub ptr %word, i32 14 monotonic
796 %atomicrmw_no_align.and = atomicrmw and ptr %word, i32 15 monotonic
797 ; CHECK: %atomicrmw_no_align.and = atomicrmw and ptr %word, i32 15 monotonic
798 %atomicrmw_no_align.nand = atomicrmw nand ptr %word, i32 16 monotonic
799 ; CHECK: %atomicrmw_no_align.nand = atomicrmw nand ptr %word, i32 16 monotonic
800 %atomicrmw_no_align.or = atomicrmw or ptr %word, i32 17 monotonic
801 ; CHECK: %atomicrmw_no_align.or = atomicrmw or ptr %word, i32 17 monotonic
802 %atomicrmw_no_align.xor = atomicrmw xor ptr %word, i32 18 monotonic
803 ; CHECK: %atomicrmw_no_align.xor = atomicrmw xor ptr %word, i32 18 monotonic
804 %atomicrmw_no_align.max = atomicrmw max ptr %word, i32 19 monotonic
805 ; CHECK: %atomicrmw_no_align.max = atomicrmw max ptr %word, i32 19 monotonic
806 %atomicrmw_no_align.min = atomicrmw volatile min ptr %word, i32 20 monotonic
807 ; CHECK: %atomicrmw_no_align.min = atomicrmw volatile min ptr %word, i32 20 monotonic
808 %atomicrmw_no_align.umax = atomicrmw umax ptr %word, i32 21 syncscope("singlethread") monotonic
809 ; CHECK: %atomicrmw_no_align.umax = atomicrmw umax ptr %word, i32 21 syncscope("singlethread") monotonic
810 %atomicrmw_no_align.umin = atomicrmw volatile umin ptr %word, i32 22 syncscope("singlethread") monotonic
811 ; CHECK: %atomicrmw_no_align.umin = atomicrmw volatile umin ptr %word, i32 22 syncscope("singlethread") monotonic
813 ;; Atomic w/ alignment
814 %atomicrmw.xchg = atomicrmw xchg ptr %word, i32 12 monotonic, align 16
815 ; CHECK: %atomicrmw.xchg = atomicrmw xchg ptr %word, i32 12 monotonic, align 16
816 %atomicrmw.add = atomicrmw add ptr %word, i32 13 monotonic, align 16
817 ; CHECK: %atomicrmw.add = atomicrmw add ptr %word, i32 13 monotonic, align 16
818 %atomicrmw.sub = atomicrmw sub ptr %word, i32 14 monotonic, align 16
819 ; CHECK: %atomicrmw.sub = atomicrmw sub ptr %word, i32 14 monotonic, align 16
820 %atomicrmw.and = atomicrmw and ptr %word, i32 15 monotonic, align 16
821 ; CHECK: %atomicrmw.and = atomicrmw and ptr %word, i32 15 monotonic, align 16
822 %atomicrmw.nand = atomicrmw nand ptr %word, i32 16 monotonic, align 16
823 ; CHECK: %atomicrmw.nand = atomicrmw nand ptr %word, i32 16 monotonic, align 16
824 %atomicrmw.or = atomicrmw or ptr %word, i32 17 monotonic, align 16
825 ; CHECK: %atomicrmw.or = atomicrmw or ptr %word, i32 17 monotonic, align 16
826 %atomicrmw.xor = atomicrmw xor ptr %word, i32 18 monotonic, align 16
827 ; CHECK: %atomicrmw.xor = atomicrmw xor ptr %word, i32 18 monotonic, align 16
828 %atomicrmw.max = atomicrmw max ptr %word, i32 19 monotonic, align 16
829 ; CHECK: %atomicrmw.max = atomicrmw max ptr %word, i32 19 monotonic, align 16
830 %atomicrmw.min = atomicrmw volatile min ptr %word, i32 20 monotonic, align 16
831 ; CHECK: %atomicrmw.min = atomicrmw volatile min ptr %word, i32 20 monotonic, align 16
832 %atomicrmw.umax = atomicrmw umax ptr %word, i32 21 syncscope("singlethread") monotonic, align 16
833 ; CHECK: %atomicrmw.umax = atomicrmw umax ptr %word, i32 21 syncscope("singlethread") monotonic, align 16
834 %atomicrmw.umin = atomicrmw volatile umin ptr %word, i32 22 syncscope("singlethread") monotonic, align 16
835 ; CHECK: %atomicrmw.umin = atomicrmw volatile umin ptr %word, i32 22 syncscope("singlethread") monotonic, align 16
838 ; CHECK: fence acquire
840 ; CHECK: fence release
842 ; CHECK: fence acq_rel
843 fence syncscope("singlethread") seq_cst
844 ; CHECK: fence syncscope("singlethread") seq_cst
846 %ld.1 = load atomic i32, ptr %word monotonic, align 4
847 ; CHECK: %ld.1 = load atomic i32, ptr %word monotonic, align 4
848 %ld.2 = load atomic volatile i32, ptr %word acquire, align 8
849 ; CHECK: %ld.2 = load atomic volatile i32, ptr %word acquire, align 8
850 %ld.3 = load atomic volatile i32, ptr %word syncscope("singlethread") seq_cst, align 16
851 ; CHECK: %ld.3 = load atomic volatile i32, ptr %word syncscope("singlethread") seq_cst, align 16
853 store atomic i32 23, ptr %word monotonic, align 4
854 ; CHECK: store atomic i32 23, ptr %word monotonic, align 4
855 store atomic volatile i32 24, ptr %word monotonic, align 4
856 ; CHECK: store atomic volatile i32 24, ptr %word monotonic, align 4
857 store atomic volatile i32 25, ptr %word syncscope("singlethread") monotonic, align 4
858 ; CHECK: store atomic volatile i32 25, ptr %word syncscope("singlethread") monotonic, align 4
862 define void @fp_atomics(ptr %word) {
863 ; CHECK: %atomicrmw.xchg = atomicrmw xchg ptr %word, float 1.000000e+00 monotonic
864 %atomicrmw.xchg = atomicrmw xchg ptr %word, float 1.0 monotonic
866 ; CHECK: %atomicrmw.fadd = atomicrmw fadd ptr %word, float 1.000000e+00 monotonic
867 %atomicrmw.fadd = atomicrmw fadd ptr %word, float 1.0 monotonic
869 ; CHECK: %atomicrmw.fsub = atomicrmw fsub ptr %word, float 1.000000e+00 monotonic
870 %atomicrmw.fsub = atomicrmw fsub ptr %word, float 1.0 monotonic
872 ; CHECK: %atomicrmw.fmax = atomicrmw fmax ptr %word, float 1.000000e+00 monotonic
873 %atomicrmw.fmax = atomicrmw fmax ptr %word, float 1.0 monotonic
875 ; CHECK: %atomicrmw.fmin = atomicrmw fmin ptr %word, float 1.000000e+00 monotonic
876 %atomicrmw.fmin = atomicrmw fmin ptr %word, float 1.0 monotonic
881 define void @uinc_udec_wrap_atomics(ptr %word) {
882 ; CHECK: %atomicrmw.inc0 = atomicrmw uinc_wrap ptr %word, i32 64 monotonic
883 %atomicrmw.inc0 = atomicrmw uinc_wrap ptr %word, i32 64 monotonic
885 ; CHECK: %atomicrmw.inc1 = atomicrmw uinc_wrap ptr %word, i32 128 seq_cst
886 %atomicrmw.inc1 = atomicrmw uinc_wrap ptr %word, i32 128 seq_cst
888 ; CHECK: %atomicrmw.inc2 = atomicrmw volatile uinc_wrap ptr %word, i32 128 seq_cst
889 %atomicrmw.inc2 = atomicrmw volatile uinc_wrap ptr %word, i32 128 seq_cst
891 ; CHECK: %atomicrmw.inc0.syncscope = atomicrmw uinc_wrap ptr %word, i32 27 syncscope("agent") monotonic
892 %atomicrmw.inc0.syncscope = atomicrmw uinc_wrap ptr %word, i32 27 syncscope("agent") monotonic
894 ; CHECK: %atomicrmw.dec0 = atomicrmw udec_wrap ptr %word, i32 99 monotonic
895 %atomicrmw.dec0 = atomicrmw udec_wrap ptr %word, i32 99 monotonic
897 ; CHECK: %atomicrmw.dec1 = atomicrmw udec_wrap ptr %word, i32 12 seq_cst
898 %atomicrmw.dec1 = atomicrmw udec_wrap ptr %word, i32 12 seq_cst
900 ; CHECK: %atomicrmw.dec2 = atomicrmw volatile udec_wrap ptr %word, i32 12 seq_cst
901 %atomicrmw.dec2 = atomicrmw volatile udec_wrap ptr %word, i32 12 seq_cst
903 ; CHECK: %atomicrmw.dec0.syncscope = atomicrmw udec_wrap ptr %word, i32 5 syncscope("system") monotonic
904 %atomicrmw.dec0.syncscope = atomicrmw udec_wrap ptr %word, i32 5 syncscope("system") monotonic
909 define void @pointer_atomics(ptr %word) {
910 ; CHECK: %atomicrmw.xchg = atomicrmw xchg ptr %word, ptr null monotonic
911 %atomicrmw.xchg = atomicrmw xchg ptr %word, ptr null monotonic
916 define void @fastmathflags_unop(float %op1) {
917 %f.nnan = fneg nnan float %op1
918 ; CHECK: %f.nnan = fneg nnan float %op1
919 %f.ninf = fneg ninf float %op1
920 ; CHECK: %f.ninf = fneg ninf float %op1
921 %f.nsz = fneg nsz float %op1
922 ; CHECK: %f.nsz = fneg nsz float %op1
923 %f.arcp = fneg arcp float %op1
924 ; CHECK: %f.arcp = fneg arcp float %op1
925 %f.contract = fneg contract float %op1
926 ; CHECK: %f.contract = fneg contract float %op1
927 %f.afn = fneg afn float %op1
928 ; CHECK: %f.afn = fneg afn float %op1
929 %f.reassoc = fneg reassoc float %op1
930 ; CHECK: %f.reassoc = fneg reassoc float %op1
931 %f.fast = fneg fast float %op1
932 ; CHECK: %f.fast = fneg fast float %op1
936 define void @fastmathflags_binops(float %op1, float %op2) {
937 %f.nnan = fadd nnan float %op1, %op2
938 ; CHECK: %f.nnan = fadd nnan float %op1, %op2
939 %f.ninf = fadd ninf float %op1, %op2
940 ; CHECK: %f.ninf = fadd ninf float %op1, %op2
941 %f.nsz = fadd nsz float %op1, %op2
942 ; CHECK: %f.nsz = fadd nsz float %op1, %op2
943 %f.arcp = fadd arcp float %op1, %op2
944 ; CHECK: %f.arcp = fadd arcp float %op1, %op2
945 %f.contract = fadd contract float %op1, %op2
946 ; CHECK: %f.contract = fadd contract float %op1, %op2
947 %f.afn = fadd afn float %op1, %op2
948 ; CHECK: %f.afn = fadd afn float %op1, %op2
949 %f.reassoc = fadd reassoc float %op1, %op2
950 ; CHECK: %f.reassoc = fadd reassoc float %op1, %op2
951 %f.fast = fadd fast float %op1, %op2
952 ; CHECK: %f.fast = fadd fast float %op1, %op2
956 define void @fastmathflags_select(i1 %cond, float %op1, float %op2) {
957 %f.nnan = select nnan i1 %cond, float %op1, float %op2
958 ; CHECK: %f.nnan = select nnan i1 %cond, float %op1, float %op2
959 %f.ninf = select ninf i1 %cond, float %op1, float %op2
960 ; CHECK: %f.ninf = select ninf i1 %cond, float %op1, float %op2
961 %f.nsz = select nsz i1 %cond, float %op1, float %op2
962 ; CHECK: %f.nsz = select nsz i1 %cond, float %op1, float %op2
963 %f.arcp = select arcp i1 %cond, float %op1, float %op2
964 ; CHECK: %f.arcp = select arcp i1 %cond, float %op1, float %op2
965 %f.contract = select contract i1 %cond, float %op1, float %op2
966 ; CHECK: %f.contract = select contract i1 %cond, float %op1, float %op2
967 %f.afn = select afn i1 %cond, float %op1, float %op2
968 ; CHECK: %f.afn = select afn i1 %cond, float %op1, float %op2
969 %f.reassoc = select reassoc i1 %cond, float %op1, float %op2
970 ; CHECK: %f.reassoc = select reassoc i1 %cond, float %op1, float %op2
971 %f.fast = select fast i1 %cond, float %op1, float %op2
972 ; CHECK: %f.fast = select fast i1 %cond, float %op1, float %op2
976 define void @fastmathflags_vector_select(<2 x i1> %cond, <2 x double> %op1, <2 x double> %op2) {
977 %f.nnan.nsz = select nnan nsz <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
978 ; CHECK: %f.nnan.nsz = select nnan nsz <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
979 %f.fast = select fast <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
980 ; CHECK: %f.fast = select fast <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
984 define void @fastmathflags_array_select(i1 %cond, [2 x double] %op1, [2 x double] %op2) {
985 %f.nnan.nsz = select nnan nsz i1 %cond, [2 x double] %op1, [2 x double] %op2
986 ; CHECK: %f.nnan.nsz = select nnan nsz i1 %cond, [2 x double] %op1, [2 x double] %op2
987 %f.fast = select fast i1 %cond, [2 x double] %op1, [2 x double] %op2
988 ; CHECK: %f.fast = select fast i1 %cond, [2 x double] %op1, [2 x double] %op2
992 define void @fastmathflags_phi(i1 %cond, float %f1, float %f2, double %d1, double %d2, half %h1, half %h2) {
994 br i1 %cond, label %L1, label %L2
1000 %p.nnan = phi nnan float [ %f1, %L1 ], [ %f2, %L2 ]
1001 ; CHECK: %p.nnan = phi nnan float [ %f1, %L1 ], [ %f2, %L2 ]
1002 %p.ninf = phi ninf double [ %d1, %L1 ], [ %d2, %L2 ]
1003 ; CHECK: %p.ninf = phi ninf double [ %d1, %L1 ], [ %d2, %L2 ]
1004 %p.contract = phi contract half [ %h1, %L1 ], [ %h2, %L2 ]
1005 ; CHECK: %p.contract = phi contract half [ %h1, %L1 ], [ %h2, %L2 ]
1006 %p.nsz.reassoc = phi reassoc nsz float [ %f1, %L1 ], [ %f2, %L2 ]
1007 ; CHECK: %p.nsz.reassoc = phi reassoc nsz float [ %f1, %L1 ], [ %f2, %L2 ]
1008 %p.fast = phi fast half [ %h2, %L1 ], [ %h1, %L2 ]
1009 ; CHECK: %p.fast = phi fast half [ %h2, %L1 ], [ %h1, %L2 ]
1013 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) {
1015 br i1 %cond, label %L1, label %L2
1021 %p.nnan = phi nnan <4 x float> [ %f1, %L1 ], [ %f2, %L2 ]
1022 ; CHECK: %p.nnan = phi nnan <4 x float> [ %f1, %L1 ], [ %f2, %L2 ]
1023 %p.ninf = phi ninf <2 x double> [ %d1, %L1 ], [ %d2, %L2 ]
1024 ; CHECK: %p.ninf = phi ninf <2 x double> [ %d1, %L1 ], [ %d2, %L2 ]
1025 %p.contract = phi contract <8 x half> [ %h1, %L1 ], [ %h2, %L2 ]
1026 ; CHECK: %p.contract = phi contract <8 x half> [ %h1, %L1 ], [ %h2, %L2 ]
1027 %p.nsz.reassoc = phi reassoc nsz <4 x float> [ %f1, %L1 ], [ %f2, %L2 ]
1028 ; CHECK: %p.nsz.reassoc = phi reassoc nsz <4 x float> [ %f1, %L1 ], [ %f2, %L2 ]
1029 %p.fast = phi fast <8 x half> [ %h2, %L1 ], [ %h1, %L2 ]
1030 ; CHECK: %p.fast = phi fast <8 x half> [ %h2, %L1 ], [ %h1, %L2 ]
1034 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) {
1036 br i1 %cond, label %L1, label %L2
1042 %p.nnan = phi nnan [4 x float] [ %f1, %L1 ], [ %f2, %L2 ]
1043 ; CHECK: %p.nnan = phi nnan [4 x float] [ %f1, %L1 ], [ %f2, %L2 ]
1044 %p.ninf = phi ninf [2 x double] [ %d1, %L1 ], [ %d2, %L2 ]
1045 ; CHECK: %p.ninf = phi ninf [2 x double] [ %d1, %L1 ], [ %d2, %L2 ]
1046 %p.contract = phi contract [8 x half] [ %h1, %L1 ], [ %h2, %L2 ]
1047 ; CHECK: %p.contract = phi contract [8 x half] [ %h1, %L1 ], [ %h2, %L2 ]
1048 %p.nsz.reassoc = phi reassoc nsz [4 x float] [ %f1, %L1 ], [ %f2, %L2 ]
1049 ; CHECK: %p.nsz.reassoc = phi reassoc nsz [4 x float] [ %f1, %L1 ], [ %f2, %L2 ]
1050 %p.fast = phi fast [8 x half] [ %h2, %L1 ], [ %h1, %L2 ]
1051 ; CHECK: %p.fast = phi fast [8 x half] [ %h2, %L1 ], [ %h1, %L2 ]
1055 ; Check various fast math flags and floating-point types on calls.
1057 declare float @fmf_f32()
1058 declare double @fmf_f64()
1059 declare <4 x double> @fmf_v4f64()
1061 ; CHECK-LABEL: fastMathFlagsForCalls(
1062 define void @fastMathFlagsForCalls(float %f, double %d1, <4 x double> %d2) {
1063 %call.fast = call fast float @fmf_f32()
1064 ; CHECK: %call.fast = call fast float @fmf_f32()
1066 ; Throw in some other attributes to make sure those stay in the right places.
1068 %call.nsz.arcp = notail call nsz arcp double @fmf_f64()
1069 ; CHECK: %call.nsz.arcp = notail call nsz arcp double @fmf_f64()
1071 %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf_v4f64()
1072 ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf_v4f64()
1077 declare [2 x float] @fmf_a2f32()
1078 declare [2 x double] @fmf_a2f64()
1079 declare [2 x <4 x double>] @fmf_a2v4f64()
1081 ; CHECK-LABEL: fastMathFlagsForArrayCalls(
1082 define void @fastMathFlagsForArrayCalls([2 x float] %f, [2 x double] %d1, [2 x <4 x double>] %d2) {
1083 %call.fast = call fast [2 x float] @fmf_a2f32()
1084 ; CHECK: %call.fast = call fast [2 x float] @fmf_a2f32()
1086 ; Throw in some other attributes to make sure those stay in the right places.
1088 %call.nsz.arcp = notail call nsz arcp [2 x double] @fmf_a2f64()
1089 ; CHECK: %call.nsz.arcp = notail call nsz arcp [2 x double] @fmf_a2f64()
1091 %call.nnan.ninf = tail call nnan ninf fastcc [2 x <4 x double>] @fmf_a2v4f64()
1092 ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc [2 x <4 x double>] @fmf_a2v4f64()
1098 %opaquety = type opaque
1099 define void @typesystem() {
1101 %t0 = alloca i1942652
1102 ; CHECK: %t0 = alloca i1942652
1104 ; CHECK: %t1 = alloca half
1106 ; CHECK: %t2 = alloca float
1108 ; CHECK: %t3 = alloca double
1110 ; CHECK: %t4 = alloca fp128
1111 %t5 = alloca x86_fp80
1112 ; CHECK: %t5 = alloca x86_fp80
1113 %t6 = alloca ppc_fp128
1114 ; CHECK: %t6 = alloca ppc_fp128
1115 %t7 = alloca x86_mmx
1116 ; CHECK: %t7 = alloca x86_mmx
1118 ; CHECK: %t8 = alloca ptr
1119 %t9 = alloca <4 x i32>
1120 ; CHECK: %t9 = alloca <4 x i32>
1121 %t10 = alloca <vscale x 4 x i32>
1122 ; CHECK: %t10 = alloca <vscale x 4 x i32>
1127 declare void @llvm.token(token)
1128 ; CHECK: declare void @llvm.token(token)
1130 ;; Inline Assembler Expressions
1131 define void @inlineasm(i32 %arg) {
1132 call i32 asm "bswap $0", "=r,r"(i32 %arg)
1133 ; CHECK: call i32 asm "bswap $0", "=r,r"(i32 %arg)
1134 call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
1135 ; CHECK: call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
1141 ; Instructions -- Terminators
1142 define void @instructions.terminators(i8 %val) personality i32 -10 {
1143 br i1 false, label %iftrue, label %iffalse
1144 ; CHECK: br i1 false, label %iftrue, label %iffalse
1146 ; CHECK: br label %iftrue
1152 switch i8 %val, label %defaultdest [
1153 ; CHECK: switch i8 %val, label %defaultdest [
1154 i8 0, label %defaultdest.0
1155 ; CHECK: i8 0, label %defaultdest.0
1156 i8 1, label %defaultdest.1
1157 ; CHECK: i8 1, label %defaultdest.1
1158 i8 2, label %defaultdest.2
1159 ; CHECK: i8 2, label %defaultdest.2
1170 indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
1171 ; CHECK: indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
1172 indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
1173 ; CHECK: indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
1175 invoke fastcc void @f.fastcc()
1176 ; CHECK: invoke fastcc void @f.fastcc()
1177 to label %defaultdest unwind label %exc
1178 ; CHECK: to label %defaultdest unwind label %exc
1180 %cleanup = landingpad i32 cleanup
1183 ; CHECK: resume i32 undef
1185 ; CHECK: resume i32 poison
1187 ; CHECK: unreachable
1192 define i32 @instructions.win_eh.1() personality i32 -3 {
1196 invoke void @f.ccc() to label %normal unwind label %catchswitch1
1197 invoke void @f.ccc() to label %normal unwind label %catchswitch2
1198 invoke void @f.ccc() to label %normal unwind label %catchswitch3
1201 %cs1 = catchswitch within none [label %catchpad1] unwind to caller
1204 catchpad within %cs1 []
1206 ; CHECK: catchpad within %cs1 []
1207 ; CHECK-NEXT: br label %normal
1210 %cs2 = catchswitch within none [label %catchpad2] unwind to caller
1213 catchpad within %cs2 [ptr %arg1]
1215 ; CHECK: catchpad within %cs2 [ptr %arg1]
1216 ; CHECK-NEXT: br label %normal
1219 %cs3 = catchswitch within none [label %catchpad3] unwind label %cleanuppad1
1222 catchpad within %cs3 [ptr %arg1, ptr %arg2]
1224 ; CHECK: catchpad within %cs3 [ptr %arg1, ptr %arg2]
1225 ; CHECK-NEXT: br label %normal
1228 %clean.1 = cleanuppad within none []
1230 ; CHECK: %clean.1 = cleanuppad within none []
1231 ; CHECK-NEXT: unreachable
1237 define i32 @instructions.win_eh.2() personality i32 -4 {
1239 invoke void @f.ccc() to label %invoke.cont unwind label %catchswitch
1242 invoke void @f.ccc() to label %continue unwind label %cleanup
1245 %clean = cleanuppad within none []
1246 ; CHECK: %clean = cleanuppad within none []
1247 cleanupret from %clean unwind to caller
1248 ; CHECK: cleanupret from %clean unwind to caller
1251 %cs = catchswitch within none [label %catchpad] unwind label %terminate
1254 %catch = catchpad within %cs []
1256 ; CHECK: %catch = catchpad within %cs []
1257 ; CHECK-NEXT: br label %body
1260 invoke void @f.ccc() [ "funclet"(token %catch) ]
1261 to label %continue unwind label %terminate.inner
1262 catchret from %catch to label %return
1263 ; CHECK: catchret from %catch to label %return
1269 cleanuppad within %catch []
1271 ; CHECK: cleanuppad within %catch []
1272 ; CHECK-NEXT: unreachable
1275 cleanuppad within none []
1277 ; CHECK: cleanuppad within none []
1278 ; CHECK-NEXT: unreachable
1284 ; Instructions -- Unary Operations
1285 define void @instructions.unops(double %op1) {
1287 ; CHECK: fneg double %op1
1291 ; Instructions -- Binary Operations
1292 define void @instructions.binops(i8 %op1, i8 %op2) {
1295 ; CHECK: add i8 %op1, %op2
1296 add nuw i8 %op1, %op2
1297 ; CHECK: add nuw i8 %op1, %op2
1298 add nsw i8 %op1, %op2
1299 ; CHECK: add nsw i8 %op1, %op2
1300 add nuw nsw i8 %op1, %op2
1301 ; CHECK: add nuw nsw i8 %op1, %op2
1303 ; CHECK: sub i8 %op1, %op2
1304 sub nuw i8 %op1, %op2
1305 ; CHECK: sub nuw i8 %op1, %op2
1306 sub nsw i8 %op1, %op2
1307 ; CHECK: sub nsw i8 %op1, %op2
1308 sub nuw nsw i8 %op1, %op2
1309 ; CHECK: sub nuw nsw i8 %op1, %op2
1311 ; CHECK: mul i8 %op1, %op2
1312 mul nuw i8 %op1, %op2
1313 ; CHECK: mul nuw i8 %op1, %op2
1314 mul nsw i8 %op1, %op2
1315 ; CHECK: mul nsw i8 %op1, %op2
1316 mul nuw nsw i8 %op1, %op2
1317 ; CHECK: mul nuw nsw i8 %op1, %op2
1321 ; CHECK: udiv i8 %op1, %op2
1322 udiv exact i8 %op1, %op2
1323 ; CHECK: udiv exact i8 %op1, %op2
1325 ; CHECK: sdiv i8 %op1, %op2
1326 sdiv exact i8 %op1, %op2
1327 ; CHECK: sdiv exact i8 %op1, %op2
1331 ; CHECK: urem i8 %op1, %op2
1333 ; CHECK: srem i8 %op1, %op2
1338 ; Instructions -- Bitwise Binary Operations
1339 define void @instructions.bitwise_binops(i8 %op1, i8 %op2) {
1342 ; CHECK: shl i8 %op1, %op2
1343 shl nuw i8 %op1, %op2
1344 ; CHECK: shl nuw i8 %op1, %op2
1345 shl nsw i8 %op1, %op2
1346 ; CHECK: shl nsw i8 %op1, %op2
1347 shl nuw nsw i8 %op1, %op2
1348 ; CHECK: shl nuw nsw i8 %op1, %op2
1352 ; CHECK: lshr i8 %op1, %op2
1353 lshr exact i8 %op1, %op2
1354 ; CHECK: lshr exact i8 %op1, %op2
1356 ; CHECK: ashr i8 %op1, %op2
1357 ashr exact i8 %op1, %op2
1358 ; CHECK: ashr exact i8 %op1, %op2
1362 ; CHECK: and i8 %op1, %op2
1364 ; CHECK: or i8 %op1, %op2
1366 ; CHECK: xor i8 %op1, %op2
1369 or disjoint i8 %op1, %op2
1370 ; CHECK: or disjoint i8 %op1, %op2
1375 ; Instructions -- Vector Operations
1376 define void @instructions.vectorops(<4 x float> %vec, <4 x float> %vec2) {
1377 extractelement <4 x float> %vec, i8 0
1378 ; CHECK: extractelement <4 x float> %vec, i8 0
1379 insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1380 ; CHECK: insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1381 shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1382 ; CHECK: shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1387 ; Instructions -- Aggregate Operations
1388 define void @instructions.aggregateops({ i8, i32 } %up, <{ i8, i32 }> %p,
1389 [3 x i8] %arr, { i8, { i32 }} %n,
1390 <2 x ptr> %pvec, <2 x i64> %offsets) {
1391 extractvalue { i8, i32 } %up, 0
1392 ; CHECK: extractvalue { i8, i32 } %up, 0
1393 extractvalue <{ i8, i32 }> %p, 1
1394 ; CHECK: extractvalue <{ i8, i32 }> %p, 1
1395 extractvalue [3 x i8] %arr, 2
1396 ; CHECK: extractvalue [3 x i8] %arr, 2
1397 extractvalue { i8, { i32 } } %n, 1, 0
1398 ; CHECK: extractvalue { i8, { i32 } } %n, 1, 0
1400 insertvalue { i8, i32 } %up, i8 1, 0
1401 ; CHECK: insertvalue { i8, i32 } %up, i8 1, 0
1402 insertvalue <{ i8, i32 }> %p, i32 2, 1
1403 ; CHECK: insertvalue <{ i8, i32 }> %p, i32 2, 1
1404 insertvalue [3 x i8] %arr, i8 0, 0
1405 ; CHECK: insertvalue [3 x i8] %arr, i8 0, 0
1406 insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1407 ; CHECK: insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1409 %up.ptr = alloca { i8, i32 }
1410 %p.ptr = alloca <{ i8, i32 }>
1411 %arr.ptr = alloca [3 x i8]
1412 %n.ptr = alloca { i8, { i32 } }
1414 getelementptr { i8, i32 }, ptr %up.ptr, i8 0
1415 ; CHECK: getelementptr { i8, i32 }, ptr %up.ptr, i8 0
1416 getelementptr <{ i8, i32 }>, ptr %p.ptr, i8 1
1417 ; CHECK: getelementptr <{ i8, i32 }>, ptr %p.ptr, i8 1
1418 getelementptr [3 x i8], ptr %arr.ptr, i8 2
1419 ; CHECK: getelementptr [3 x i8], ptr %arr.ptr, i8 2
1420 getelementptr { i8, { i32 } }, ptr %n.ptr, i32 0, i32 1
1421 ; CHECK: getelementptr { i8, { i32 } }, ptr %n.ptr, i32 0, i32 1
1422 getelementptr inbounds { i8, { i32 } }, ptr %n.ptr, i32 1, i32 0
1423 ; CHECK: getelementptr inbounds { i8, { i32 } }, ptr %n.ptr, i32 1, i32 0
1424 getelementptr i8, <2 x ptr> %pvec, <2 x i64> %offsets
1425 ; CHECK: getelementptr i8, <2 x ptr> %pvec, <2 x i64> %offsets
1430 ; Instructions -- Memory Access and Addressing Operations
1434 define void @instructions.memops(ptr %base) {
1435 alloca i32, i8 4, align 4
1436 ; CHECK: alloca i32, i8 4, align 4
1437 alloca inalloca i32, i8 4, align 4
1438 ; CHECK: alloca inalloca i32, i8 4, align 4
1440 load ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !8, !dereferenceable !9, !dereferenceable_or_null !9
1441 ; CHECK: load ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !8, !dereferenceable !9, !dereferenceable_or_null !9
1442 load volatile ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !8, !dereferenceable !9, !dereferenceable_or_null !9
1443 ; CHECK: load volatile ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !8, !dereferenceable !9, !dereferenceable_or_null !9
1445 store ptr null, ptr %base, align 4, !nontemporal !8
1446 ; CHECK: store ptr null, ptr %base, align 4, !nontemporal !8
1447 store volatile ptr null, ptr %base, align 4, !nontemporal !8
1448 ; CHECK: store volatile ptr null, ptr %base, align 4, !nontemporal !8
1453 ; Instructions -- Conversion Operations
1454 define void @instructions.conversions() {
1456 ; CHECK: trunc i32 -1 to i1
1458 ; CHECK: zext i32 -1 to i64
1460 ; CHECK: sext i32 -1 to i64
1461 fptrunc float undef to half
1462 ; CHECK: fptrunc float undef to half
1463 fpext half undef to float
1464 ; CHECK: fpext half undef to float
1465 fptoui float undef to i32
1466 ; CHECK: fptoui float undef to i32
1467 fptosi float undef to i32
1468 ; CHECK: fptosi float undef to i32
1469 fptrunc float poison to half
1470 ; CHECK: fptrunc float poison to half
1471 fpext half poison to float
1472 ; CHECK: fpext half poison to float
1473 fptoui float poison to i32
1474 ; CHECK: fptoui float poison to i32
1475 fptosi float poison to i32
1476 ; CHECK: fptosi float poison to i32
1477 uitofp i32 1 to float
1478 ; CHECK: uitofp i32 1 to float
1479 sitofp i32 -1 to float
1480 ; CHECK: sitofp i32 -1 to float
1481 ptrtoint ptr null to i64
1482 ; CHECK: ptrtoint ptr null to i64
1483 inttoptr i64 0 to ptr
1484 ; CHECK: inttoptr i64 0 to ptr
1485 bitcast i32 0 to i32
1486 ; CHECK: bitcast i32 0 to i32
1487 addrspacecast ptr null to ptr addrspace(1)
1488 ; CHECK: addrspacecast ptr null to ptr addrspace(1)
1493 ; Instructions -- Other Operations
1494 define void @instructions.other(i32 %op1, i32 %op2, half %fop1, half %fop2, <2 x i32> %vop, ptr %pop) {
1496 icmp eq i32 %op1, %op2
1497 ; CHECK: icmp eq i32 %op1, %op2
1498 icmp ne i32 %op1, %op2
1499 ; CHECK: icmp ne i32 %op1, %op2
1500 icmp ugt i32 %op1, %op2
1501 ; CHECK: icmp ugt i32 %op1, %op2
1502 icmp uge i32 %op1, %op2
1503 ; CHECK: icmp uge i32 %op1, %op2
1504 icmp ult i32 %op1, %op2
1505 ; CHECK: icmp ult i32 %op1, %op2
1506 icmp ule i32 %op1, %op2
1507 ; CHECK: icmp ule i32 %op1, %op2
1508 icmp sgt i32 %op1, %op2
1509 ; CHECK: icmp sgt i32 %op1, %op2
1510 icmp sge i32 %op1, %op2
1511 ; CHECK: icmp sge i32 %op1, %op2
1512 icmp slt i32 %op1, %op2
1513 ; CHECK: icmp slt i32 %op1, %op2
1514 icmp sle i32 %op1, %op2
1515 ; CHECK: icmp sle i32 %op1, %op2
1517 fcmp false half %fop1, %fop2
1518 ; CHECK: fcmp false half %fop1, %fop2
1519 fcmp oeq half %fop1, %fop2
1520 ; CHECK: fcmp oeq half %fop1, %fop2
1521 fcmp ogt half %fop1, %fop2
1522 ; CHECK: fcmp ogt half %fop1, %fop2
1523 fcmp oge half %fop1, %fop2
1524 ; CHECK: fcmp oge half %fop1, %fop2
1525 fcmp olt half %fop1, %fop2
1526 ; CHECK: fcmp olt half %fop1, %fop2
1527 fcmp ole half %fop1, %fop2
1528 ; CHECK: fcmp ole half %fop1, %fop2
1529 fcmp one half %fop1, %fop2
1530 ; CHECK: fcmp one half %fop1, %fop2
1531 fcmp ord half %fop1, %fop2
1532 ; CHECK: fcmp ord half %fop1, %fop2
1533 fcmp ueq half %fop1, %fop2
1534 ; CHECK: fcmp ueq half %fop1, %fop2
1535 fcmp ugt half %fop1, %fop2
1536 ; CHECK: fcmp ugt half %fop1, %fop2
1537 fcmp uge half %fop1, %fop2
1538 ; CHECK: fcmp uge half %fop1, %fop2
1539 fcmp ult half %fop1, %fop2
1540 ; CHECK: fcmp ult half %fop1, %fop2
1541 fcmp ule half %fop1, %fop2
1542 ; CHECK: fcmp ule half %fop1, %fop2
1543 fcmp une half %fop1, %fop2
1544 ; CHECK: fcmp une half %fop1, %fop2
1545 fcmp uno half %fop1, %fop2
1546 ; CHECK: fcmp uno half %fop1, %fop2
1547 fcmp true half %fop1, %fop2
1548 ; CHECK: fcmp true half %fop1, %fop2
1552 %v1 = add i32 %op1, %op2
1555 %v2 = add i32 %op1, %op2
1558 phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1559 ; CHECK: phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1561 select i1 true, i32 0, i32 1
1562 ; CHECK: select i1 true, i32 0, i32 1
1563 select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1564 ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1566 call void @f.nobuiltin() builtin
1567 ; CHECK: call void @f.nobuiltin() #52
1569 call fastcc noalias ptr @f.noalias() noinline
1570 ; CHECK: call fastcc noalias ptr @f.noalias() #12
1571 tail call ghccc nonnull ptr @f.nonnull() minsize
1572 ; CHECK: tail call ghccc nonnull ptr @f.nonnull() #7
1575 ; CHECK: freeze i32 %op1
1577 ; CHECK: freeze i32 10
1579 ; CHECK: freeze half %fop1
1580 freeze <2 x i32> %vop
1581 ; CHECK: freeze <2 x i32> %vop
1583 ; CHECK: freeze ptr %pop
1587 define void @instructions.call_musttail(ptr inalloca(i8) %val) {
1588 musttail call void @f.param.inalloca(ptr inalloca(i8) %val)
1589 ; CHECK: musttail call void @f.param.inalloca(ptr inalloca(i8) %val)
1594 define void @instructions.call_notail() {
1595 notail call void @f1()
1596 ; CHECK: notail call void @f1()
1601 define void @instructions.landingpad() personality i32 -2 {
1602 invoke void @llvm.donothing() to label %proceed unwind label %catch1
1603 invoke void @llvm.donothing() to label %proceed unwind label %catch2
1604 invoke void @llvm.donothing() to label %proceed unwind label %catch3
1605 invoke void @llvm.donothing() to label %proceed unwind label %catch4
1609 ; CHECK: landingpad i32
1616 ; CHECK: landingpad i32
1620 ; CHECK: catch ptr null
1625 ; CHECK: landingpad i32
1629 ; CHECK: catch ptr null
1631 ; CHECK: catch ptr null
1636 ; CHECK: landingpad i32
1637 filter [2 x i32] zeroinitializer
1638 ; CHECK: filter [2 x i32] zeroinitializer
1645 ;; Intrinsic Functions
1647 ; Intrinsic Functions -- Variable Argument Handling
1648 declare void @llvm.va_start(ptr)
1649 declare void @llvm.va_copy(ptr, ptr)
1650 declare void @llvm.va_end(ptr)
1651 define void @instructions.va_arg(ptr %v, ...) {
1654 call void @llvm.va_start(ptr %ap)
1655 ; CHECK: call void @llvm.va_start.p0(ptr %ap)
1658 ; CHECK: va_arg ptr %ap, i32
1660 call void @llvm.va_copy(ptr %v, ptr %ap)
1661 ; CHECK: call void @llvm.va_copy.p0(ptr %v, ptr %ap)
1663 call void @llvm.va_end(ptr %ap)
1664 ; CHECK: call void @llvm.va_end.p0(ptr %ap)
1669 ; Intrinsic Functions -- Accurate Garbage Collection
1670 declare void @llvm.gcroot(ptr, ptr)
1671 declare ptr @llvm.gcread(ptr, ptr)
1672 declare void @llvm.gcwrite(ptr, ptr, ptr)
1673 define void @intrinsics.gc() gc "shadow-stack" {
1674 %ptrloc = alloca ptr
1675 call void @llvm.gcroot(ptr %ptrloc, ptr null)
1676 ; CHECK: call void @llvm.gcroot(ptr %ptrloc, ptr null)
1678 call ptr @llvm.gcread(ptr null, ptr %ptrloc)
1679 ; CHECK: call ptr @llvm.gcread(ptr null, ptr %ptrloc)
1682 call void @llvm.gcwrite(ptr %ref, ptr null, ptr %ptrloc)
1683 ; CHECK: call void @llvm.gcwrite(ptr %ref, ptr null, ptr %ptrloc)
1688 ; Intrinsic Functions -- Code Generation
1689 declare ptr @llvm.returnaddress(i32)
1690 declare ptr @llvm.frameaddress(i32)
1691 declare i32 @llvm.read_register.i32(metadata)
1692 declare i64 @llvm.read_register.i64(metadata)
1693 declare void @llvm.write_register.i32(metadata, i32)
1694 declare void @llvm.write_register.i64(metadata, i64)
1695 declare ptr @llvm.stacksave()
1696 declare void @llvm.stackrestore(ptr)
1697 declare void @llvm.prefetch.p0(ptr, i32, i32, i32)
1698 declare void @llvm.pcmarker(i32)
1699 declare i64 @llvm.readcyclecounter()
1700 declare void @llvm.clear_cache(ptr, ptr)
1701 declare void @llvm.instrprof_increment(ptr, i64, i32, i32)
1704 define void @intrinsics.codegen() {
1705 call ptr @llvm.returnaddress(i32 1)
1706 ; CHECK: call ptr @llvm.returnaddress(i32 1)
1707 call ptr @llvm.frameaddress(i32 1)
1708 ; CHECK: call ptr @llvm.frameaddress.p0(i32 1)
1710 call i32 @llvm.read_register.i32(metadata !10)
1711 ; CHECK: call i32 @llvm.read_register.i32(metadata !10)
1712 call i64 @llvm.read_register.i64(metadata !10)
1713 ; CHECK: call i64 @llvm.read_register.i64(metadata !10)
1714 call void @llvm.write_register.i32(metadata !10, i32 0)
1715 ; CHECK: call void @llvm.write_register.i32(metadata !10, i32 0)
1716 call void @llvm.write_register.i64(metadata !10, i64 0)
1717 ; CHECK: call void @llvm.write_register.i64(metadata !10, i64 0)
1719 %stack = call ptr @llvm.stacksave()
1720 ; CHECK: %stack = call ptr @llvm.stacksave.p0()
1721 call void @llvm.stackrestore(ptr %stack)
1722 ; CHECK: call void @llvm.stackrestore.p0(ptr %stack)
1724 call void @llvm.prefetch.p0(ptr %stack, i32 0, i32 3, i32 0)
1725 ; CHECK: call void @llvm.prefetch.p0(ptr %stack, i32 0, i32 3, i32 0)
1727 call void @llvm.pcmarker(i32 1)
1728 ; CHECK: call void @llvm.pcmarker(i32 1)
1730 call i64 @llvm.readcyclecounter()
1731 ; CHECK: call i64 @llvm.readcyclecounter()
1733 call void @llvm.clear_cache(ptr null, ptr null)
1734 ; CHECK: call void @llvm.clear_cache(ptr null, ptr null)
1736 call void @llvm.instrprof_increment(ptr null, i64 0, i32 0, i32 0)
1737 ; CHECK: call void @llvm.instrprof_increment(ptr null, i64 0, i32 0, i32 0)
1742 declare void @llvm.localescape(...)
1743 declare ptr @llvm.localrecover(ptr %func, ptr %fp, i32 %idx)
1744 define void @intrinsics.localescape() {
1745 %static.alloca = alloca i32
1746 call void (...) @llvm.localescape(ptr %static.alloca)
1747 ; CHECK: call void (...) @llvm.localescape(ptr %static.alloca)
1749 call void @intrinsics.localrecover()
1753 define void @intrinsics.localrecover() {
1754 %fp = call ptr @llvm.frameaddress(i32 1)
1755 call ptr @llvm.localrecover(ptr @intrinsics.localescape, ptr %fp, i32 0)
1756 ; CHECK: call ptr @llvm.localrecover(ptr @intrinsics.localescape, ptr %fp, i32 0)
1761 ; We need this function to provide `uses' for some metadata tests.
1762 define void @misc.metadata() {
1763 call void @f1(), !srcloc !11
1764 call void @f1(), !srcloc !12
1765 call void @f1(), !srcloc !13
1766 call void @f1(), !srcloc !14
1770 declare void @op_bundle_callee_0()
1771 declare void @op_bundle_callee_1(i32,i32)
1773 define void @call_with_operand_bundle0(ptr %ptr) {
1774 ; CHECK-LABEL: call_with_operand_bundle0(
1776 %l = load i32, ptr %ptr
1778 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1779 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1783 define void @call_with_operand_bundle1(ptr %ptr) {
1784 ; CHECK-LABEL: call_with_operand_bundle1(
1786 %l = load i32, ptr %ptr
1789 call void @op_bundle_callee_0()
1790 call void @op_bundle_callee_0() [ "foo"() ]
1791 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1792 ; CHECK: @op_bundle_callee_0(){{$}}
1793 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"() ]
1794 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1798 define void @call_with_operand_bundle2(ptr %ptr) {
1799 ; CHECK-LABEL: call_with_operand_bundle2(
1801 call void @op_bundle_callee_0() [ "foo"() ]
1802 ; CHECK: call void @op_bundle_callee_0() [ "foo"() ]
1806 define void @call_with_operand_bundle3(ptr %ptr) {
1807 ; CHECK-LABEL: call_with_operand_bundle3(
1809 %l = load i32, ptr %ptr
1811 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1812 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1816 define void @call_with_operand_bundle4(ptr %ptr) {
1817 ; CHECK-LABEL: call_with_operand_bundle4(
1819 %l = load i32, ptr %ptr
1821 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) ]
1822 ; 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) ]
1826 ; Invoke versions of the above tests:
1829 define void @invoke_with_operand_bundle0(ptr %ptr) personality i8 3 {
1830 ; CHECK-LABEL: @invoke_with_operand_bundle0(
1832 %l = load i32, ptr %ptr
1834 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
1835 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1838 %cleanup = landingpad i8 cleanup
1844 define void @invoke_with_operand_bundle1(ptr %ptr) personality i8 3 {
1845 ; CHECK-LABEL: @invoke_with_operand_bundle1(
1847 %l = load i32, ptr %ptr
1850 invoke void @op_bundle_callee_0() to label %normal unwind label %exception
1851 ; CHECK: invoke void @op_bundle_callee_0(){{$}}
1854 %cleanup = landingpad i8 cleanup
1858 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal1 unwind label %exception1
1859 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1862 %cleanup1 = landingpad i8 cleanup
1866 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
1867 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1870 %cleanup2 = landingpad i8 cleanup
1877 define void @invoke_with_operand_bundle2(ptr %ptr) personality i8 3 {
1878 ; CHECK-LABEL: @invoke_with_operand_bundle2(
1880 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal unwind label %exception
1881 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1884 %cleanup = landingpad i8 cleanup
1890 define void @invoke_with_operand_bundle3(ptr %ptr) personality i8 3 {
1891 ; CHECK-LABEL: @invoke_with_operand_bundle3(
1893 %l = load i32, ptr %ptr
1895 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
1896 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1899 %cleanup = landingpad i8 cleanup
1905 define void @invoke_with_operand_bundle4(ptr %ptr) personality i8 3 {
1906 ; CHECK-LABEL: @invoke_with_operand_bundle4(
1908 %l = load i32, ptr %ptr
1910 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) ]
1911 to label %normal unwind label %exception
1912 ; 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) ]
1915 %cleanup = landingpad i8 cleanup
1921 declare void @vaargs_func(...)
1922 define void @invoke_with_operand_bundle_vaarg(ptr %ptr) personality i8 3 {
1923 ; CHECK-LABEL: @invoke_with_operand_bundle_vaarg(
1925 %l = load i32, ptr %ptr
1927 invoke void (...) @vaargs_func(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1928 to label %normal unwind label %exception
1929 ; 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) ]
1932 %cleanup = landingpad i8 cleanup
1939 declare void @f.writeonly() writeonly
1940 ; CHECK: declare void @f.writeonly() #42
1942 declare void @f.speculatable() speculatable
1943 ; CHECK: declare void @f.speculatable() #43
1945 ;; Constant Expressions
1947 define ptr @constexpr() {
1948 ; CHECK: ret ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr], [4 x ptr] }, ptr null, i32 0, i32 1, i32 2)
1949 ret ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr], [4 x ptr] }, ptr null, i32 0, i32 1, i32 2)
1952 define void @instructions.strictfp() strictfp {
1953 call void @f.strictfp() strictfp
1954 ; CHECK: call void @f.strictfp() #44
1959 declare void @f.nosanitize_coverage() nosanitize_coverage
1960 ; CHECK: declare void @f.nosanitize_coverage() #45
1962 declare void @f.disable_sanitizer_instrumentation() disable_sanitizer_instrumentation
1963 ; CHECK: declare void @f.disable_sanitizer_instrumentation() #46
1966 declare void @llvm.test.immarg.intrinsic(i32 immarg)
1967 ; CHECK: declare void @llvm.test.immarg.intrinsic(i32 immarg)
1969 ; byval attribute with type
1970 %named_type = type [8 x i8]
1971 declare void @byval_type(ptr byval(i32) align 2)
1972 declare void @byval_type2(ptr byval({ i8, ptr }))
1973 declare void @byval_named_type(ptr byval(%named_type))
1974 ; CHECK: declare void @byval_type(ptr byval(i32) align 2)
1975 ; CHECK: declare void @byval_type2(ptr byval({ i8, ptr }))
1976 ; CHECK: declare void @byval_named_type(ptr byval([8 x i8]))
1978 declare void @f.allocsize_one(i32) allocsize(0)
1979 declare void @f.allocsize_two(i32, i32) allocsize(1, 0)
1980 ; CHECK: Function Attrs: allocsize(0)
1981 ; CHECK: declare void @f.allocsize_one(i32)
1982 ; CHECK: Function Attrs: allocsize(1,0)
1983 ; CHECK: declare void @f.allocsize_two(i32, i32)
1985 declare void @f.nosanitize_bounds() nosanitize_bounds
1986 ; CHECK: declare void @f.nosanitize_bounds() #49
1988 declare void @f.allockind() allockind("alloc,uninitialized")
1989 ; CHECK: declare void @f.allockind() #50
1991 declare void @f.sanitize_numerical_stability() sanitize_numerical_stability
1992 ; CHECK: declare void @f.sanitize_numerical_stability() #51
1994 ; CHECK: declare nofpclass(snan) float @nofpclass_snan(float nofpclass(snan))
1995 declare nofpclass(snan) float @nofpclass_snan(float nofpclass(snan))
1997 ; CHECK: declare nofpclass(qnan) float @nofpclass_qnan(float nofpclass(qnan))
1998 declare nofpclass(qnan) float @nofpclass_qnan(float nofpclass(qnan))
2000 ; CHECK: declare nofpclass(ninf) float @nofpclass_ninf(float nofpclass(ninf))
2001 declare nofpclass(ninf) float @nofpclass_ninf(float nofpclass(ninf))
2003 ; CHECK: declare nofpclass(nnorm) float @nofpclass_nnorm(float nofpclass(nnorm))
2004 declare nofpclass(nnorm) float @nofpclass_nnorm(float nofpclass(nnorm))
2006 ; CHECK: declare nofpclass(nsub) float @nofpclass_nsub(float nofpclass(nsub))
2007 declare nofpclass(nsub) float @nofpclass_nsub(float nofpclass(nsub))
2009 ; CHECK: declare nofpclass(nzero) float @nofpclass_nzero(float nofpclass(nzero))
2010 declare nofpclass(nzero) float @nofpclass_nzero(float nofpclass(nzero))
2012 ; CHECK: declare nofpclass(pzero) float @nofpclass_pzero(float nofpclass(pzero))
2013 declare nofpclass(pzero) float @nofpclass_pzero(float nofpclass(pzero))
2015 ; CHECK: declare nofpclass(psub) float @nofpclass_psub(float nofpclass(psub))
2016 declare nofpclass(psub) float @nofpclass_psub(float nofpclass(psub))
2018 ; CHECK: declare nofpclass(pnorm) float @nofpclass_pnorm(float nofpclass(pnorm))
2019 declare nofpclass(pnorm) float @nofpclass_pnorm(float nofpclass(pnorm))
2021 ; CHECK: declare nofpclass(pinf) float @nofpclass_pinf(float nofpclass(pinf))
2022 declare nofpclass(pinf) float @nofpclass_pinf(float nofpclass(pinf))
2024 ; CHECK: declare nofpclass(nan) float @nofpclass_nan(float nofpclass(nan))
2025 declare nofpclass(nan) float @nofpclass_nan(float nofpclass(nan))
2027 ; CHECK: declare nofpclass(inf) float @nofpclass_inf(float nofpclass(inf))
2028 declare nofpclass(inf) float @nofpclass_inf(float nofpclass(inf))
2030 ; CHECK: declare nofpclass(norm) float @nofpclass_norm(float nofpclass(norm))
2031 declare nofpclass(norm) float @nofpclass_norm(float nofpclass(norm))
2033 ; CHECK: declare nofpclass(zero) float @nofpclass_zero(float nofpclass(zero))
2034 declare nofpclass(zero) float @nofpclass_zero(float nofpclass(zero))
2036 ; CHECK: declare nofpclass(sub) float @nofpclass_sub(float nofpclass(sub))
2037 declare nofpclass(sub) float @nofpclass_sub(float nofpclass(sub))
2039 ; CHECK: declare nofpclass(all) float @nofpclass_all(float nofpclass(all))
2040 declare nofpclass(all) float @nofpclass_all(float nofpclass(all))
2042 ; CHECK: declare nofpclass(zero sub) float @nofpclass_sub_zero(float nofpclass(zero sub))
2043 declare nofpclass(sub zero) float @nofpclass_sub_zero(float nofpclass(sub zero))
2045 ; CHECK: declare nofpclass(inf sub) float @nofpclass_sub_inf(float nofpclass(inf sub))
2046 declare nofpclass(sub inf) float @nofpclass_sub_inf(float nofpclass(sub inf))
2048 declare float @unknown_fpclass_func(float)
2050 define float @nofpclass_callsites(float %arg) {
2051 ; CHECK: %call0 = call nofpclass(nan) float @unknown_fpclass_func(float nofpclass(ninf) %arg)
2052 %call0 = call nofpclass(nan) float @unknown_fpclass_func(float nofpclass(ninf) %arg)
2054 ; CHECK: %call1 = call nofpclass(inf) float @unknown_fpclass_func(float nofpclass(inf) %arg)
2055 %call1 = call nofpclass(inf) float @unknown_fpclass_func(float nofpclass(inf) %arg)
2057 ; CHECK: %call2 = call nofpclass(zero) float @unknown_fpclass_func(float nofpclass(norm) %arg)
2058 %call2 = call nofpclass(zero) float @unknown_fpclass_func(float nofpclass(norm) %arg)
2059 %add0 = fadd float %call0, %call1
2060 %add1 = fadd float %add0, %call2
2064 ; CHECK: attributes #0 = { alignstack=4 }
2065 ; CHECK: attributes #1 = { alignstack=8 }
2066 ; CHECK: attributes #2 = { alwaysinline }
2067 ; CHECK: attributes #3 = { cold }
2068 ; CHECK: attributes #4 = { convergent }
2069 ; CHECK: attributes #5 = { inlinehint }
2070 ; CHECK: attributes #6 = { jumptable }
2071 ; CHECK: attributes #7 = { minsize }
2072 ; CHECK: attributes #8 = { naked }
2073 ; CHECK: attributes #9 = { nobuiltin }
2074 ; CHECK: attributes #10 = { noduplicate }
2075 ; CHECK: attributes #11 = { noimplicitfloat }
2076 ; CHECK: attributes #12 = { noinline }
2077 ; CHECK: attributes #13 = { nonlazybind }
2078 ; CHECK: attributes #14 = { noredzone }
2079 ; CHECK: attributes #15 = { noreturn }
2080 ; CHECK: attributes #16 = { nounwind }
2081 ; CHECK: attributes #17 = { noinline optnone }
2082 ; CHECK: attributes #18 = { optsize }
2083 ; CHECK: attributes #19 = { memory(none) }
2084 ; CHECK: attributes #20 = { memory(read) }
2085 ; CHECK: attributes #21 = { returns_twice }
2086 ; CHECK: attributes #22 = { safestack }
2087 ; CHECK: attributes #23 = { sanitize_address }
2088 ; CHECK: attributes #24 = { sanitize_memory }
2089 ; CHECK: attributes #25 = { sanitize_thread }
2090 ; CHECK: attributes #26 = { ssp }
2091 ; CHECK: attributes #27 = { sspreq }
2092 ; CHECK: attributes #28 = { sspstrong }
2093 ; CHECK: attributes #29 = { "thunk" }
2094 ; CHECK: attributes #30 = { uwtable }
2095 ; CHECK: attributes #31 = { "cpu"="cortex-a8" }
2096 ; CHECK: attributes #32 = { norecurse }
2097 ; CHECK: attributes #33 = { memory(inaccessiblemem: readwrite) }
2098 ; CHECK: attributes #34 = { memory(argmem: readwrite, inaccessiblemem: readwrite) }
2099 ; CHECK: attributes #35 = { nocallback nofree nosync nounwind willreturn memory(none) }
2100 ; CHECK: attributes #36 = { nounwind memory(argmem: read) }
2101 ; CHECK: attributes #37 = { nounwind memory(argmem: readwrite) }
2102 ; CHECK: attributes #38 = { nocallback nofree nosync nounwind willreturn memory(read) }
2103 ; CHECK: attributes #39 = { nocallback nounwind }
2104 ; CHECK: attributes #40 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
2105 ; CHECK: attributes #41 = { nocallback nofree nosync nounwind willreturn }
2106 ; CHECK: attributes #42 = { memory(write) }
2107 ; CHECK: attributes #43 = { speculatable }
2108 ; CHECK: attributes #44 = { strictfp }
2109 ; CHECK: attributes #45 = { nosanitize_coverage }
2110 ; CHECK: attributes #46 = { disable_sanitizer_instrumentation }
2111 ; CHECK: attributes #47 = { allocsize(0) }
2112 ; CHECK: attributes #48 = { allocsize(1,0) }
2113 ; CHECK: attributes #49 = { nosanitize_bounds }
2114 ; CHECK: attributes #50 = { allockind("alloc,uninitialized") }
2115 ; CHECK: attributes #51 = { sanitize_numerical_stability }
2116 ; CHECK: attributes #52 = { builtin }
2120 ; Metadata -- Module flags
2121 !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
2122 ; CHECK: !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
2124 !0 = !{i32 1, !"mod1", i32 0}
2125 ; CHECK: !0 = !{i32 1, !"mod1", i32 0}
2126 !1 = !{i32 2, !"mod2", i32 0}
2127 ; CHECK: !1 = !{i32 2, !"mod2", i32 0}
2128 !2 = !{i32 3, !"mod3", !3}
2129 ; CHECK: !2 = !{i32 3, !"mod3", !3}
2131 ; CHECK: !3 = !{!"mod6", !0}
2132 !4 = !{i32 4, !"mod4", i32 0}
2133 ; CHECK: !4 = !{i32 4, !"mod4", i32 0}
2134 !5 = !{i32 5, !"mod5", !0}
2135 ; CHECK: !5 = !{i32 5, !"mod5", !0}
2136 !6 = !{i32 6, !"mod6", !0}
2137 ; CHECK: !6 = !{i32 6, !"mod6", !0}
2139 ; Metadata -- Check `distinct'
2141 ; CHECK: !11 = distinct !{}
2143 ; CHECK: !12 = distinct !{}
2145 ; CHECK: !13 = !{!11}
2147 ; CHECK: !14 = !{!12}