1 ; Bitcode compatibility test for llvm
3 ; Please update this file when making any IR changes. Information on the
4 ; release process for this file is available here:
6 ; http://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility
8 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
9 ; RUN-PR24755: verify-uselistorder < %s
11 target datalayout = "E"
12 ; CHECK: target datalayout = "E"
14 target triple = "x86_64-apple-macosx10.10.0"
15 ; CHECK: target triple = "x86_64-apple-macosx10.10.0"
17 ;; Module-level assembly
18 module asm "beep boop"
19 ; CHECK: module asm "beep boop"
22 $comdat.any = comdat any
23 ; CHECK: $comdat.any = comdat any
24 $comdat.exactmatch = comdat exactmatch
25 ; CHECK: $comdat.exactmatch = comdat exactmatch
26 $comdat.largest = comdat largest
27 ; CHECK: $comdat.largest = comdat largest
28 $comdat.noduplicates = comdat 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 i8* null
43 ; CHECK: @const.null = constant i8* 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, void ()*, i8* }
193 @g.used1 = global i32 0
194 @g.used2 = global i32 0
195 @g.used3 = global i8 0
197 @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
198 ; CHECK: @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
199 @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
200 ; CHECK: @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
201 @llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
202 ; CHECK: @llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
203 @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
204 ; CHECK: @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
207 ; Format: @<Name> = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
208 ; [unnamed_addr] alias <AliaseeTy> @<Aliasee>
211 @a.private = private alias i32, i32* @g.private
212 ; CHECK: @a.private = private alias i32, i32* @g.private
213 @a.internal = internal alias i32, i32* @g.internal
214 ; CHECK: @a.internal = internal alias i32, i32* @g.internal
215 @a.linkonce = linkonce alias i32, i32* @g.linkonce
216 ; CHECK: @a.linkonce = linkonce alias i32, i32* @g.linkonce
217 @a.weak = weak alias i32, i32* @g.weak
218 ; CHECK: @a.weak = weak alias i32, i32* @g.weak
219 @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
220 ; CHECK: @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
221 @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
222 ; CHECK: @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
223 @a.external = external alias i32, i32* @g1
224 ; CHECK: @a.external = alias i32, i32* @g1
226 ; Aliases -- Visibility
227 @a.default = default alias i32, i32* @g.default
228 ; CHECK: @a.default = alias i32, i32* @g.default
229 @a.hidden = hidden alias i32, i32* @g.hidden
230 ; CHECK: @a.hidden = hidden alias i32, i32* @g.hidden
231 @a.protected = protected alias i32, i32* @g.protected
232 ; CHECK: @a.protected = protected alias i32, i32* @g.protected
234 ; Aliases -- DLLStorageClass
235 @a.dlldefault = default alias i32, i32* @g.dlldefault
236 ; CHECK: @a.dlldefault = alias i32, i32* @g.dlldefault
237 @a.dllexport = dllexport alias i32, i32* @g.dllexport
238 ; CHECK: @a.dllexport = dllexport alias i32, i32* @g.dllexport
240 ; Aliases -- ThreadLocal
241 @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
242 ; CHECK: @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
243 @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
244 ; CHECK: @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
245 @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
246 ; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
247 @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
248 ; CHECK: @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
249 @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
250 ; CHECK: @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
252 ; Aliases -- unnamed_addr and local_unnamed_addr
253 @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
254 ; CHECK: @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
255 @a.local_unnamed_addr = local_unnamed_addr alias i32, i32* @g.local_unnamed_addr
256 ; CHECK: @a.local_unnamed_addr = local_unnamed_addr alias i32, i32* @g.local_unnamed_addr
258 ; Aliases -- partition
259 ; CHECK: @alias.partition = alias i32, i32* @g.partition, partition "part"
260 @alias.partition = alias i32, i32* @g.partition, partition "part"
263 ; Format @<Name> = [Linkage] [Visibility] ifunc <IFuncTy>,
264 ; <ResolverTy>* @<Resolver>
267 @ifunc.external = external ifunc void (), void ()* ()* @ifunc_resolver
268 ; CHECK: @ifunc.external = ifunc void (), void ()* ()* @ifunc_resolver
269 @ifunc.private = private ifunc void (), void ()* ()* @ifunc_resolver
270 ; CHECK: @ifunc.private = private ifunc void (), void ()* ()* @ifunc_resolver
271 @ifunc.internal = internal ifunc void (), void ()* ()* @ifunc_resolver
272 ; CHECK: @ifunc.internal = internal ifunc void (), void ()* ()* @ifunc_resolver
274 ; IFunc -- Visibility
275 @ifunc.default = default ifunc void (), void ()* ()* @ifunc_resolver
276 ; CHECK: @ifunc.default = ifunc void (), void ()* ()* @ifunc_resolver
277 @ifunc.hidden = hidden ifunc void (), void ()* ()* @ifunc_resolver
278 ; CHECK: @ifunc.hidden = hidden ifunc void (), void ()* ()* @ifunc_resolver
279 @ifunc.protected = protected ifunc void (), void ()* ()* @ifunc_resolver
280 ; CHECK: @ifunc.protected = protected ifunc void (), void ()* ()* @ifunc_resolver
283 ; CHECK: @ifunc.partition = ifunc void (), void ()* ()* @ifunc_resolver, partition "part"
284 @ifunc.partition = ifunc void (), void ()* ()* @ifunc_resolver, partition "part"
286 define void ()* @ifunc_resolver() {
292 ; Format: define [linkage] [visibility] [DLLStorageClass]
293 ; [cconv] [ret attrs]
294 ; <ResultType> @<FunctionName> ([argument list])
295 ; [(unnamed_addr|local_unnamed_addr)] [fn Attrs] [section "name"] [comdat [($name)]]
296 ; [align N] [gc] [prefix Constant] [prologue Constant]
297 ; [personality Constant] { ... }
299 ; Functions -- Simple
301 ; CHECK: declare void @f1()
304 ; CHECK: define void @f2()
309 ; Functions -- linkage
310 define private void @f.private() {
311 ; CHECK: define private void @f.private()
315 define internal void @f.internal() {
316 ; CHECK: define internal void @f.internal()
320 define available_externally void @f.available_externally() {
321 ; CHECK: define available_externally void @f.available_externally()
325 define linkonce void @f.linkonce() {
326 ; CHECK: define linkonce void @f.linkonce()
330 define weak void @f.weak() {
331 ; CHECK: define weak void @f.weak()
335 define linkonce_odr void @f.linkonce_odr() {
336 ; CHECK: define linkonce_odr void @f.linkonce_odr()
340 define weak_odr void @f.weak_odr() {
341 ; CHECK: define weak_odr void @f.weak_odr()
345 declare external void @f.external()
346 ; CHECK: declare void @f.external()
347 declare extern_weak void @f.extern_weak()
348 ; CHECK: declare extern_weak void @f.extern_weak()
350 ; Functions -- visibility
351 declare default void @f.default()
352 ; CHECK: declare void @f.default()
353 declare hidden void @f.hidden()
354 ; CHECK: declare hidden void @f.hidden()
355 declare protected void @f.protected()
356 ; CHECK: declare protected void @f.protected()
358 ; Functions -- DLLStorageClass
359 declare dllimport void @f.dllimport()
360 ; CHECK: declare dllimport void @f.dllimport()
361 declare dllexport void @f.dllexport()
362 ; CHECK: declare dllexport void @f.dllexport()
364 ; Functions -- cconv (Calling conventions)
365 declare ccc void @f.ccc()
366 ; CHECK: declare void @f.ccc()
367 declare fastcc void @f.fastcc()
368 ; CHECK: declare fastcc void @f.fastcc()
369 declare coldcc void @f.coldcc()
370 ; CHECK: declare coldcc void @f.coldcc()
371 declare cc10 void @f.cc10()
372 ; CHECK: declare ghccc void @f.cc10()
373 declare ghccc void @f.ghccc()
374 ; CHECK: declare ghccc void @f.ghccc()
375 declare cc11 void @f.cc11()
376 ; CHECK: declare cc11 void @f.cc11()
377 declare webkit_jscc void @f.webkit_jscc()
378 ; CHECK: declare webkit_jscc void @f.webkit_jscc()
379 declare anyregcc void @f.anyregcc()
380 ; CHECK: declare anyregcc void @f.anyregcc()
381 declare preserve_mostcc void @f.preserve_mostcc()
382 ; CHECK: declare preserve_mostcc void @f.preserve_mostcc()
383 declare preserve_allcc void @f.preserve_allcc()
384 ; CHECK: declare preserve_allcc void @f.preserve_allcc()
385 declare swifttailcc void @f.swifttailcc()
386 ; CHECK: declare swifttailcc void @f.swifttailcc()
387 declare cc64 void @f.cc64()
388 ; CHECK: declare x86_stdcallcc void @f.cc64()
389 declare x86_stdcallcc void @f.x86_stdcallcc()
390 ; CHECK: declare x86_stdcallcc void @f.x86_stdcallcc()
391 declare cc65 void @f.cc65()
392 ; CHECK: declare x86_fastcallcc void @f.cc65()
393 declare x86_fastcallcc void @f.x86_fastcallcc()
394 ; CHECK: declare x86_fastcallcc void @f.x86_fastcallcc()
395 declare cc66 void @f.cc66()
396 ; CHECK: declare arm_apcscc void @f.cc66()
397 declare arm_apcscc void @f.arm_apcscc()
398 ; CHECK: declare arm_apcscc void @f.arm_apcscc()
399 declare cc67 void @f.cc67()
400 ; CHECK: declare arm_aapcscc void @f.cc67()
401 declare arm_aapcscc void @f.arm_aapcscc()
402 ; CHECK: declare arm_aapcscc void @f.arm_aapcscc()
403 declare cc68 void @f.cc68()
404 ; CHECK: declare arm_aapcs_vfpcc void @f.cc68()
405 declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
406 ; CHECK: declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
407 declare cc69 void @f.cc69()
408 ; CHECK: declare msp430_intrcc void @f.cc69()
409 declare msp430_intrcc void @f.msp430_intrcc()
410 ; CHECK: declare msp430_intrcc void @f.msp430_intrcc()
411 declare cc70 void @f.cc70()
412 ; CHECK: declare x86_thiscallcc void @f.cc70()
413 declare x86_thiscallcc void @f.x86_thiscallcc()
414 ; CHECK: declare x86_thiscallcc void @f.x86_thiscallcc()
415 declare cc71 void @f.cc71()
416 ; CHECK: declare ptx_kernel void @f.cc71()
417 declare ptx_kernel void @f.ptx_kernel()
418 ; CHECK: declare ptx_kernel void @f.ptx_kernel()
419 declare cc72 void @f.cc72()
420 ; CHECK: declare ptx_device void @f.cc72()
421 declare ptx_device void @f.ptx_device()
422 ; CHECK: declare ptx_device void @f.ptx_device()
423 declare cc75 void @f.cc75()
424 ; CHECK: declare spir_func void @f.cc75()
425 declare spir_func void @f.spir_func()
426 ; CHECK: declare spir_func void @f.spir_func()
427 declare cc76 void @f.cc76()
428 ; CHECK: declare spir_kernel void @f.cc76()
429 declare spir_kernel void @f.spir_kernel()
430 ; CHECK: declare spir_kernel void @f.spir_kernel()
431 declare cc77 void @f.cc77()
432 ; CHECK: declare intel_ocl_bicc void @f.cc77()
433 declare intel_ocl_bicc void @f.intel_ocl_bicc()
434 ; CHECK: declare intel_ocl_bicc void @f.intel_ocl_bicc()
435 declare cc78 void @f.cc78()
436 ; CHECK: declare x86_64_sysvcc void @f.cc78()
437 declare x86_64_sysvcc void @f.x86_64_sysvcc()
438 ; CHECK: declare x86_64_sysvcc void @f.x86_64_sysvcc()
439 declare cc79 void @f.cc79()
440 ; CHECK: declare win64cc void @f.cc79()
441 declare win64cc void @f.win64cc()
442 ; CHECK: declare win64cc void @f.win64cc()
443 declare cc80 void @f.cc80()
444 ; CHECK: declare x86_vectorcallcc void @f.cc80()
445 declare x86_vectorcallcc void @f.x86_vectorcallcc()
446 ; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc()
447 declare cc81 void @f.cc81()
448 ; CHECK: declare hhvmcc void @f.cc81()
449 declare hhvmcc void @f.hhvmcc()
450 ; CHECK: declare hhvmcc void @f.hhvmcc()
451 declare cc82 void @f.cc82()
452 ; CHECK: declare hhvm_ccc void @f.cc82()
453 declare hhvm_ccc void @f.hhvm_ccc()
454 ; CHECK: declare hhvm_ccc void @f.hhvm_ccc()
455 declare cc83 void @f.cc83(i8* byval(i8))
456 ; CHECK: declare x86_intrcc void @f.cc83(i8* byval(i8))
457 declare x86_intrcc void @f.x86_intrcc(i8* byval(i8))
458 ; CHECK: declare x86_intrcc void @f.x86_intrcc(i8* byval(i8))
459 declare cc84 void @f.cc84()
460 ; CHECK: declare avr_intrcc void @f.cc84()
461 declare avr_intrcc void @f.avr_intrcc()
462 ; CHECK: declare avr_intrcc void @f.avr_intrcc()
463 declare cc85 void @f.cc85()
464 ; CHECK: declare avr_signalcc void @f.cc85()
465 declare avr_signalcc void @f.avr_signalcc()
466 ; CHECK: declare avr_signalcc void @f.avr_signalcc()
467 declare cc87 void @f.cc87()
468 ; CHECK: declare amdgpu_vs void @f.cc87()
469 declare amdgpu_vs void @f.amdgpu_vs()
470 ; CHECK: declare amdgpu_vs void @f.amdgpu_vs()
471 declare cc88 void @f.cc88()
472 ; CHECK: declare amdgpu_gs void @f.cc88()
473 declare amdgpu_gs void @f.amdgpu_gs()
474 ; CHECK: declare amdgpu_gs void @f.amdgpu_gs()
475 declare cc89 void @f.cc89()
476 ; CHECK: declare amdgpu_ps void @f.cc89()
477 declare amdgpu_ps void @f.amdgpu_ps()
478 ; CHECK: declare amdgpu_ps void @f.amdgpu_ps()
479 declare cc90 void @f.cc90()
480 ; CHECK: declare amdgpu_cs void @f.cc90()
481 declare amdgpu_cs void @f.amdgpu_cs()
482 ; CHECK: declare amdgpu_cs void @f.amdgpu_cs()
483 declare amdgpu_gfx void @f.amdgpu_gfx()
484 ; CHECK: declare amdgpu_gfx void @f.amdgpu_gfx()
485 declare cc91 void @f.cc91()
486 ; CHECK: declare amdgpu_kernel void @f.cc91()
487 declare amdgpu_kernel void @f.amdgpu_kernel()
488 ; CHECK: declare amdgpu_kernel void @f.amdgpu_kernel()
489 declare cc93 void @f.cc93()
490 ; CHECK: declare amdgpu_hs void @f.cc93()
491 declare amdgpu_hs void @f.amdgpu_hs()
492 ; CHECK: declare amdgpu_hs void @f.amdgpu_hs()
493 declare cc95 void @f.cc95()
494 ; CHECK: declare amdgpu_ls void @f.cc95()
495 declare amdgpu_ls void @f.amdgpu_ls()
496 ; CHECK: declare amdgpu_ls void @f.amdgpu_ls()
497 declare cc96 void @f.cc96()
498 ; CHECK: declare amdgpu_es void @f.cc96()
499 declare amdgpu_es void @f.amdgpu_es()
500 ; CHECK: declare amdgpu_es void @f.amdgpu_es()
501 declare cc1023 void @f.cc1023()
502 ; CHECK: declare cc1023 void @f.cc1023()
504 ; Functions -- ret attrs (Return attributes)
505 declare zeroext i64 @f.zeroext()
506 ; CHECK: declare zeroext i64 @f.zeroext()
507 declare signext i64 @f.signext()
508 ; CHECK: declare signext i64 @f.signext()
509 declare inreg i32* @f.inreg()
510 ; CHECK: declare inreg i32* @f.inreg()
511 declare noalias i32* @f.noalias()
512 ; CHECK: declare noalias i32* @f.noalias()
513 declare nonnull i32* @f.nonnull()
514 ; CHECK: declare nonnull i32* @f.nonnull()
515 declare dereferenceable(4) i32* @f.dereferenceable4()
516 ; CHECK: declare dereferenceable(4) i32* @f.dereferenceable4()
517 declare dereferenceable(8) i32* @f.dereferenceable8()
518 ; CHECK: declare dereferenceable(8) i32* @f.dereferenceable8()
519 declare dereferenceable(16) i32* @f.dereferenceable16()
520 ; CHECK: declare dereferenceable(16) i32* @f.dereferenceable16()
521 declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
522 ; CHECK: declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
523 declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
524 ; CHECK: declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
525 declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
526 ; CHECK: declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
528 ; Functions -- Parameter attributes
529 declare void @f.param.zeroext(i8 zeroext)
530 ; CHECK: declare void @f.param.zeroext(i8 zeroext)
531 declare void @f.param.signext(i8 signext)
532 ; CHECK: declare void @f.param.signext(i8 signext)
533 declare void @f.param.inreg(i8 inreg)
534 ; CHECK: declare void @f.param.inreg(i8 inreg)
535 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
536 ; CHECK: declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
537 declare void @f.param.inalloca(i8* inalloca(i8))
538 ; CHECK: declare void @f.param.inalloca(i8* inalloca(i8))
539 declare void @f.param.sret(i8* sret(i8))
540 ; CHECK: declare void @f.param.sret(i8* sret(i8))
541 declare void @f.param.noalias(i8* noalias)
542 ; CHECK: declare void @f.param.noalias(i8* noalias)
543 declare void @f.param.nocapture(i8* nocapture)
544 ; CHECK: declare void @f.param.nocapture(i8* nocapture)
545 declare void @f.param.nest(i8* nest)
546 ; CHECK: declare void @f.param.nest(i8* nest)
547 declare i8* @f.param.returned(i8* returned)
548 ; CHECK: declare i8* @f.param.returned(i8* returned)
549 declare void @f.param.nonnull(i8* nonnull)
550 ; CHECK: declare void @f.param.nonnull(i8* nonnull)
551 declare void @f.param.dereferenceable(i8* dereferenceable(4))
552 ; CHECK: declare void @f.param.dereferenceable(i8* dereferenceable(4))
553 declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
554 ; CHECK: declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
555 declare void @f.param.stack_align([2 x double] alignstack(16))
556 ; CHECK: declare void @f.param.stack_align([2 x double] alignstack(16))
557 declare void @f.param.swiftself(i8* swiftself)
558 ; CHECK: declare void @f.param.swiftself(i8* swiftself)
559 declare void @f.param.swiftasync(i8* swiftasync)
560 ; CHECK: declare void @f.param.swiftasync(i8* swiftasync)
561 declare void @f.param.swifterror(i8** swifterror)
562 ; CHECK: declare void @f.param.swifterror(i8** swifterror)
564 ; Functions -- unnamed_addr and local_unnamed_addr
565 declare void @f.unnamed_addr() unnamed_addr
566 ; CHECK: declare void @f.unnamed_addr() unnamed_addr
567 declare void @f.local_unnamed_addr() local_unnamed_addr
568 ; CHECK: declare void @f.local_unnamed_addr() local_unnamed_addr
570 ; Functions -- fn Attrs (Function attributes)
571 declare void @f.alignstack4() alignstack(4)
572 ; CHECK: declare void @f.alignstack4() #0
573 declare void @f.alignstack8() alignstack(8)
574 ; CHECK: declare void @f.alignstack8() #1
575 declare void @f.alwaysinline() alwaysinline
576 ; CHECK: declare void @f.alwaysinline() #2
577 declare void @f.cold() cold
578 ; CHECK: declare void @f.cold() #3
579 declare void @f.convergent() convergent
580 ; CHECK: declare void @f.convergent() #4
581 declare void @f.inlinehint() inlinehint
582 ; CHECK: declare void @f.inlinehint() #5
583 declare void @f.jumptable() unnamed_addr jumptable
584 ; CHECK: declare void @f.jumptable() unnamed_addr #6
585 declare void @f.minsize() minsize
586 ; CHECK: declare void @f.minsize() #7
587 declare void @f.naked() naked
588 ; CHECK: declare void @f.naked() #8
589 declare void @f.nobuiltin() nobuiltin
590 ; CHECK: declare void @f.nobuiltin() #9
591 declare void @f.noduplicate() noduplicate
592 ; CHECK: declare void @f.noduplicate() #10
593 declare void @f.noimplicitfloat() noimplicitfloat
594 ; CHECK: declare void @f.noimplicitfloat() #11
595 declare void @f.noinline() noinline
596 ; CHECK: declare void @f.noinline() #12
597 declare void @f.nonlazybind() nonlazybind
598 ; CHECK: declare void @f.nonlazybind() #13
599 declare void @f.noredzone() noredzone
600 ; CHECK: declare void @f.noredzone() #14
601 declare void @f.noreturn() noreturn
602 ; CHECK: declare void @f.noreturn() #15
603 declare void @f.nounwind() nounwind
604 ; CHECK: declare void @f.nounwind() #16
605 declare void @f.optnone() noinline optnone
606 ; CHECK: declare void @f.optnone() #17
607 declare void @f.optsize() optsize
608 ; CHECK: declare void @f.optsize() #18
609 declare void @f.readnone() readnone
610 ; CHECK: declare void @f.readnone() #19
611 declare void @f.readonly() readonly
612 ; CHECK: declare void @f.readonly() #20
613 declare void @f.returns_twice() returns_twice
614 ; CHECK: declare void @f.returns_twice() #21
615 declare void @f.safestack() safestack
616 ; CHECK: declare void @f.safestack() #22
617 declare void @f.sanitize_address() sanitize_address
618 ; CHECK: declare void @f.sanitize_address() #23
619 declare void @f.sanitize_memory() sanitize_memory
620 ; CHECK: declare void @f.sanitize_memory() #24
621 declare void @f.sanitize_thread() sanitize_thread
622 ; CHECK: declare void @f.sanitize_thread() #25
623 declare void @f.ssp() ssp
624 ; CHECK: declare void @f.ssp() #26
625 declare void @f.sspreq() sspreq
626 ; CHECK: declare void @f.sspreq() #27
627 declare void @f.sspstrong() sspstrong
628 ; CHECK: declare void @f.sspstrong() #28
629 declare void @f.thunk() "thunk"
630 ; CHECK: declare void @f.thunk() #29
631 declare void @f.uwtable() uwtable
632 ; CHECK: declare void @f.uwtable() #30
633 declare void @f.kvpair() "cpu"="cortex-a8"
634 ; CHECK:declare void @f.kvpair() #31
635 declare void @f.norecurse() norecurse
636 ; CHECK: declare void @f.norecurse() #32
637 declare void @f.inaccessiblememonly() inaccessiblememonly
638 ; CHECK: declare void @f.inaccessiblememonly() #33
639 declare void @f.inaccessiblemem_or_argmemonly() inaccessiblemem_or_argmemonly
640 ; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #34
641 declare void @f.strictfp() #35
643 ; Functions -- section
644 declare void @f.section() section "80"
645 ; CHECK: declare void @f.section() section "80"
647 ; Functions -- partition
648 define void @f.partition() partition "part" {
649 ; CHECK: define void @f.partition() partition "part"
653 ; Functions -- comdat
654 define void @f.comdat_any() comdat($comdat.any) {
655 ; CHECK: define void @f.comdat_any() comdat($comdat.any)
659 define void @f.comdat_exactmatch() comdat($comdat.exactmatch) {
660 ; CHECK: define void @f.comdat_exactmatch() comdat($comdat.exactmatch)
664 define void @f.comdat_largest() comdat($comdat.largest) {
665 ; CHECK: define void @f.comdat_largest() comdat($comdat.largest)
669 define void @f.comdat_noduplicates() comdat($comdat.noduplicates) {
670 ; CHECK: define void @f.comdat_noduplicates() comdat($comdat.noduplicates)
674 define void @f.comdat_samesize() comdat($comdat.samesize) {
675 ; CHECK: define void @f.comdat_samesize() comdat($comdat.samesize)
681 declare void @f.align2() align 2
682 ; CHECK: declare void @f.align2() align 2
683 declare void @f.align4() align 4
684 ; CHECK: declare void @f.align4() align 4
685 declare void @f.align8() align 8
686 ; CHECK: declare void @f.align8() align 8
689 declare void @f.gcshadow() gc "shadow-stack"
690 ; CHECK: declare void @f.gcshadow() gc "shadow-stack"
692 ; Functions -- Prefix data
693 declare void @f.prefixi32() prefix i32 1684365668
694 ; CHECK: declare void @f.prefixi32() prefix i32 1684365668
695 declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
696 ; CHECK: declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
698 ; Functions -- Prologue data
699 declare void @f.prologuei32() prologue i32 1684365669
700 ; CHECK: declare void @f.prologuei32() prologue i32 1684365669
701 declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
702 ; CHECK: declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
704 ; Functions -- Personality constant
705 declare void @llvm.donothing() nounwind readnone
706 ; CHECK: declare void @llvm.donothing() #35
707 define void @f.no_personality() personality i8 3 {
708 ; CHECK: define void @f.no_personality() personality i8 3
709 invoke void @llvm.donothing() to label %normal unwind label %exception
711 %cleanup = landingpad i8 cleanup
717 declare i32 @f.personality_handler()
718 ; CHECK: declare i32 @f.personality_handler()
719 define void @f.personality() personality i32 ()* @f.personality_handler {
720 ; CHECK: define void @f.personality() personality i32 ()* @f.personality_handler
721 invoke void @llvm.donothing() to label %normal unwind label %exception
723 %cleanup = landingpad i32 cleanup
729 ;; Atomic Memory Ordering Constraints
730 define void @atomics(i32* %word) {
731 ;; Atomic Compare And Exchange w/o alignment
732 %cmpxchg_no_align.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
733 ; CHECK: %cmpxchg_no_align.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
734 %cmpxchg_no_align.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
735 ; CHECK: %cmpxchg_no_align.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
736 %cmpxchg_no_align.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
737 ; CHECK: %cmpxchg_no_align.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
738 %cmpxchg_no_align.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
739 ; CHECK: %cmpxchg_no_align.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
740 %cmpxchg_no_align.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
741 ; CHECK: %cmpxchg_no_align.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
742 %cmpxchg_no_align.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
743 ; CHECK: %cmpxchg_no_align.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
744 %cmpxchg_no_align.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
745 ; CHECK: %cmpxchg_no_align.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
746 %cmpxchg_no_align.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
747 ; CHECK: %cmpxchg_no_align.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
749 ;; Atomic Compare And Exchange w/ alignment
750 %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic, align 16
751 ; CHECK: %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic, align 16
752 %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic, align 16
753 ; CHECK: %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic, align 16
754 %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic, align 16
755 ; CHECK: %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic, align 16
756 %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic, align 16
757 ; CHECK: %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic, align 16
758 %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic, align 16
759 ; CHECK: %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic, align 16
760 %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic, align 16
761 ; CHECK: %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic, align 16
762 %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic, align 16
763 ; CHECK: %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic, align 16
764 %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic, align 16
765 ; CHECK: %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic, align 16
767 ;; Atomic w/o alignment
768 %atomicrmw_no_align.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
769 ; CHECK: %atomicrmw_no_align.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
770 %atomicrmw_no_align.add = atomicrmw add i32* %word, i32 13 monotonic
771 ; CHECK: %atomicrmw_no_align.add = atomicrmw add i32* %word, i32 13 monotonic
772 %atomicrmw_no_align.sub = atomicrmw sub i32* %word, i32 14 monotonic
773 ; CHECK: %atomicrmw_no_align.sub = atomicrmw sub i32* %word, i32 14 monotonic
774 %atomicrmw_no_align.and = atomicrmw and i32* %word, i32 15 monotonic
775 ; CHECK: %atomicrmw_no_align.and = atomicrmw and i32* %word, i32 15 monotonic
776 %atomicrmw_no_align.nand = atomicrmw nand i32* %word, i32 16 monotonic
777 ; CHECK: %atomicrmw_no_align.nand = atomicrmw nand i32* %word, i32 16 monotonic
778 %atomicrmw_no_align.or = atomicrmw or i32* %word, i32 17 monotonic
779 ; CHECK: %atomicrmw_no_align.or = atomicrmw or i32* %word, i32 17 monotonic
780 %atomicrmw_no_align.xor = atomicrmw xor i32* %word, i32 18 monotonic
781 ; CHECK: %atomicrmw_no_align.xor = atomicrmw xor i32* %word, i32 18 monotonic
782 %atomicrmw_no_align.max = atomicrmw max i32* %word, i32 19 monotonic
783 ; CHECK: %atomicrmw_no_align.max = atomicrmw max i32* %word, i32 19 monotonic
784 %atomicrmw_no_align.min = atomicrmw volatile min i32* %word, i32 20 monotonic
785 ; CHECK: %atomicrmw_no_align.min = atomicrmw volatile min i32* %word, i32 20 monotonic
786 %atomicrmw_no_align.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic
787 ; CHECK: %atomicrmw_no_align.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic
788 %atomicrmw_no_align.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic
789 ; CHECK: %atomicrmw_no_align.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic
791 ;; Atomic w/ alignment
792 %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic, align 16
793 ; CHECK: %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic, align 16
794 %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic, align 16
795 ; CHECK: %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic, align 16
796 %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic, align 16
797 ; CHECK: %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic, align 16
798 %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic, align 16
799 ; CHECK: %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic, align 16
800 %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic, align 16
801 ; CHECK: %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic, align 16
802 %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic, align 16
803 ; CHECK: %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic, align 16
804 %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic, align 16
805 ; CHECK: %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic, align 16
806 %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic, align 16
807 ; CHECK: %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic, align 16
808 %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic, align 16
809 ; CHECK: %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic, align 16
810 %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic, align 16
811 ; CHECK: %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic, align 16
812 %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic, align 16
813 ; CHECK: %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic, align 16
816 ; CHECK: fence acquire
818 ; CHECK: fence release
820 ; CHECK: fence acq_rel
821 fence syncscope("singlethread") seq_cst
822 ; CHECK: fence syncscope("singlethread") seq_cst
824 %ld.1 = load atomic i32, i32* %word monotonic, align 4
825 ; CHECK: %ld.1 = load atomic i32, i32* %word monotonic, align 4
826 %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
827 ; CHECK: %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
828 %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16
829 ; CHECK: %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16
831 store atomic i32 23, i32* %word monotonic, align 4
832 ; CHECK: store atomic i32 23, i32* %word monotonic, align 4
833 store atomic volatile i32 24, i32* %word monotonic, align 4
834 ; CHECK: store atomic volatile i32 24, i32* %word monotonic, align 4
835 store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4
836 ; CHECK: store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4
840 define void @fp_atomics(float* %word) {
841 ; CHECK: %atomicrmw.xchg = atomicrmw xchg float* %word, float 1.000000e+00 monotonic
842 %atomicrmw.xchg = atomicrmw xchg float* %word, float 1.0 monotonic
844 ; CHECK: %atomicrmw.fadd = atomicrmw fadd float* %word, float 1.000000e+00 monotonic
845 %atomicrmw.fadd = atomicrmw fadd float* %word, float 1.0 monotonic
847 ; CHECK: %atomicrmw.fsub = atomicrmw fsub float* %word, float 1.000000e+00 monotonic
848 %atomicrmw.fsub = atomicrmw fsub float* %word, float 1.0 monotonic
854 define void @fastmathflags_unop(float %op1) {
855 %f.nnan = fneg nnan float %op1
856 ; CHECK: %f.nnan = fneg nnan float %op1
857 %f.ninf = fneg ninf float %op1
858 ; CHECK: %f.ninf = fneg ninf float %op1
859 %f.nsz = fneg nsz float %op1
860 ; CHECK: %f.nsz = fneg nsz float %op1
861 %f.arcp = fneg arcp float %op1
862 ; CHECK: %f.arcp = fneg arcp float %op1
863 %f.contract = fneg contract float %op1
864 ; CHECK: %f.contract = fneg contract float %op1
865 %f.afn = fneg afn float %op1
866 ; CHECK: %f.afn = fneg afn float %op1
867 %f.reassoc = fneg reassoc float %op1
868 ; CHECK: %f.reassoc = fneg reassoc float %op1
869 %f.fast = fneg fast float %op1
870 ; CHECK: %f.fast = fneg fast float %op1
874 define void @fastmathflags_binops(float %op1, float %op2) {
875 %f.nnan = fadd nnan float %op1, %op2
876 ; CHECK: %f.nnan = fadd nnan float %op1, %op2
877 %f.ninf = fadd ninf float %op1, %op2
878 ; CHECK: %f.ninf = fadd ninf float %op1, %op2
879 %f.nsz = fadd nsz float %op1, %op2
880 ; CHECK: %f.nsz = fadd nsz float %op1, %op2
881 %f.arcp = fadd arcp float %op1, %op2
882 ; CHECK: %f.arcp = fadd arcp float %op1, %op2
883 %f.contract = fadd contract float %op1, %op2
884 ; CHECK: %f.contract = fadd contract float %op1, %op2
885 %f.afn = fadd afn float %op1, %op2
886 ; CHECK: %f.afn = fadd afn float %op1, %op2
887 %f.reassoc = fadd reassoc float %op1, %op2
888 ; CHECK: %f.reassoc = fadd reassoc float %op1, %op2
889 %f.fast = fadd fast float %op1, %op2
890 ; CHECK: %f.fast = fadd fast float %op1, %op2
894 define void @fastmathflags_select(i1 %cond, float %op1, float %op2) {
895 %f.nnan = select nnan i1 %cond, float %op1, float %op2
896 ; CHECK: %f.nnan = select nnan i1 %cond, float %op1, float %op2
897 %f.ninf = select ninf i1 %cond, float %op1, float %op2
898 ; CHECK: %f.ninf = select ninf i1 %cond, float %op1, float %op2
899 %f.nsz = select nsz i1 %cond, float %op1, float %op2
900 ; CHECK: %f.nsz = select nsz i1 %cond, float %op1, float %op2
901 %f.arcp = select arcp i1 %cond, float %op1, float %op2
902 ; CHECK: %f.arcp = select arcp i1 %cond, float %op1, float %op2
903 %f.contract = select contract i1 %cond, float %op1, float %op2
904 ; CHECK: %f.contract = select contract i1 %cond, float %op1, float %op2
905 %f.afn = select afn i1 %cond, float %op1, float %op2
906 ; CHECK: %f.afn = select afn i1 %cond, float %op1, float %op2
907 %f.reassoc = select reassoc i1 %cond, float %op1, float %op2
908 ; CHECK: %f.reassoc = select reassoc i1 %cond, float %op1, float %op2
909 %f.fast = select fast i1 %cond, float %op1, float %op2
910 ; CHECK: %f.fast = select fast i1 %cond, float %op1, float %op2
914 define void @fastmathflags_vector_select(<2 x i1> %cond, <2 x double> %op1, <2 x double> %op2) {
915 %f.nnan.nsz = select nnan nsz <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
916 ; CHECK: %f.nnan.nsz = select nnan nsz <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
917 %f.fast = select fast <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
918 ; CHECK: %f.fast = select fast <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
922 define void @fastmathflags_array_select(i1 %cond, [2 x double] %op1, [2 x double] %op2) {
923 %f.nnan.nsz = select nnan nsz i1 %cond, [2 x double] %op1, [2 x double] %op2
924 ; CHECK: %f.nnan.nsz = select nnan nsz i1 %cond, [2 x double] %op1, [2 x double] %op2
925 %f.fast = select fast i1 %cond, [2 x double] %op1, [2 x double] %op2
926 ; CHECK: %f.fast = select fast i1 %cond, [2 x double] %op1, [2 x double] %op2
930 define void @fastmathflags_phi(i1 %cond, float %f1, float %f2, double %d1, double %d2, half %h1, half %h2) {
932 br i1 %cond, label %L1, label %L2
938 %p.nnan = phi nnan float [ %f1, %L1 ], [ %f2, %L2 ]
939 ; CHECK: %p.nnan = phi nnan float [ %f1, %L1 ], [ %f2, %L2 ]
940 %p.ninf = phi ninf double [ %d1, %L1 ], [ %d2, %L2 ]
941 ; CHECK: %p.ninf = phi ninf double [ %d1, %L1 ], [ %d2, %L2 ]
942 %p.contract = phi contract half [ %h1, %L1 ], [ %h2, %L2 ]
943 ; CHECK: %p.contract = phi contract half [ %h1, %L1 ], [ %h2, %L2 ]
944 %p.nsz.reassoc = phi reassoc nsz float [ %f1, %L1 ], [ %f2, %L2 ]
945 ; CHECK: %p.nsz.reassoc = phi reassoc nsz float [ %f1, %L1 ], [ %f2, %L2 ]
946 %p.fast = phi fast half [ %h2, %L1 ], [ %h1, %L2 ]
947 ; CHECK: %p.fast = phi fast half [ %h2, %L1 ], [ %h1, %L2 ]
951 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) {
953 br i1 %cond, label %L1, label %L2
959 %p.nnan = phi nnan <4 x float> [ %f1, %L1 ], [ %f2, %L2 ]
960 ; CHECK: %p.nnan = phi nnan <4 x float> [ %f1, %L1 ], [ %f2, %L2 ]
961 %p.ninf = phi ninf <2 x double> [ %d1, %L1 ], [ %d2, %L2 ]
962 ; CHECK: %p.ninf = phi ninf <2 x double> [ %d1, %L1 ], [ %d2, %L2 ]
963 %p.contract = phi contract <8 x half> [ %h1, %L1 ], [ %h2, %L2 ]
964 ; CHECK: %p.contract = phi contract <8 x half> [ %h1, %L1 ], [ %h2, %L2 ]
965 %p.nsz.reassoc = phi reassoc nsz <4 x float> [ %f1, %L1 ], [ %f2, %L2 ]
966 ; CHECK: %p.nsz.reassoc = phi reassoc nsz <4 x float> [ %f1, %L1 ], [ %f2, %L2 ]
967 %p.fast = phi fast <8 x half> [ %h2, %L1 ], [ %h1, %L2 ]
968 ; CHECK: %p.fast = phi fast <8 x half> [ %h2, %L1 ], [ %h1, %L2 ]
972 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) {
974 br i1 %cond, label %L1, label %L2
980 %p.nnan = phi nnan [4 x float] [ %f1, %L1 ], [ %f2, %L2 ]
981 ; CHECK: %p.nnan = phi nnan [4 x float] [ %f1, %L1 ], [ %f2, %L2 ]
982 %p.ninf = phi ninf [2 x double] [ %d1, %L1 ], [ %d2, %L2 ]
983 ; CHECK: %p.ninf = phi ninf [2 x double] [ %d1, %L1 ], [ %d2, %L2 ]
984 %p.contract = phi contract [8 x half] [ %h1, %L1 ], [ %h2, %L2 ]
985 ; CHECK: %p.contract = phi contract [8 x half] [ %h1, %L1 ], [ %h2, %L2 ]
986 %p.nsz.reassoc = phi reassoc nsz [4 x float] [ %f1, %L1 ], [ %f2, %L2 ]
987 ; CHECK: %p.nsz.reassoc = phi reassoc nsz [4 x float] [ %f1, %L1 ], [ %f2, %L2 ]
988 %p.fast = phi fast [8 x half] [ %h2, %L1 ], [ %h1, %L2 ]
989 ; CHECK: %p.fast = phi fast [8 x half] [ %h2, %L1 ], [ %h1, %L2 ]
993 ; Check various fast math flags and floating-point types on calls.
995 declare float @fmf_f32()
996 declare double @fmf_f64()
997 declare <4 x double> @fmf_v4f64()
999 ; CHECK-LABEL: fastMathFlagsForCalls(
1000 define void @fastMathFlagsForCalls(float %f, double %d1, <4 x double> %d2) {
1001 %call.fast = call fast float @fmf_f32()
1002 ; CHECK: %call.fast = call fast float @fmf_f32()
1004 ; Throw in some other attributes to make sure those stay in the right places.
1006 %call.nsz.arcp = notail call nsz arcp double @fmf_f64()
1007 ; CHECK: %call.nsz.arcp = notail call nsz arcp double @fmf_f64()
1009 %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf_v4f64()
1010 ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf_v4f64()
1015 declare [2 x float] @fmf_a2f32()
1016 declare [2 x double] @fmf_a2f64()
1017 declare [2 x <4 x double>] @fmf_a2v4f64()
1019 ; CHECK-LABEL: fastMathFlagsForArrayCalls(
1020 define void @fastMathFlagsForArrayCalls([2 x float] %f, [2 x double] %d1, [2 x <4 x double>] %d2) {
1021 %call.fast = call fast [2 x float] @fmf_a2f32()
1022 ; CHECK: %call.fast = call fast [2 x float] @fmf_a2f32()
1024 ; Throw in some other attributes to make sure those stay in the right places.
1026 %call.nsz.arcp = notail call nsz arcp [2 x double] @fmf_a2f64()
1027 ; CHECK: %call.nsz.arcp = notail call nsz arcp [2 x double] @fmf_a2f64()
1029 %call.nnan.ninf = tail call nnan ninf fastcc [2 x <4 x double>] @fmf_a2v4f64()
1030 ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc [2 x <4 x double>] @fmf_a2v4f64()
1036 %opaquety = type opaque
1037 define void @typesystem() {
1038 %p0 = bitcast i8* null to i32 (i32)*
1039 ; CHECK: %p0 = bitcast i8* null to i32 (i32)*
1040 %p1 = bitcast i8* null to void (i8*)*
1041 ; CHECK: %p1 = bitcast i8* null to void (i8*)*
1042 %p2 = bitcast i8* null to i32 (i8*, ...)*
1043 ; CHECK: %p2 = bitcast i8* null to i32 (i8*, ...)*
1044 %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
1045 ; CHECK: %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
1046 %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
1047 ; CHECK: %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
1048 %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
1049 ; CHECK: %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
1051 %t0 = alloca i1942652
1052 ; CHECK: %t0 = alloca i1942652
1054 ; CHECK: %t1 = alloca half
1056 ; CHECK: %t2 = alloca float
1058 ; CHECK: %t3 = alloca double
1060 ; CHECK: %t4 = alloca fp128
1061 %t5 = alloca x86_fp80
1062 ; CHECK: %t5 = alloca x86_fp80
1063 %t6 = alloca ppc_fp128
1064 ; CHECK: %t6 = alloca ppc_fp128
1065 %t7 = alloca x86_mmx
1066 ; CHECK: %t7 = alloca x86_mmx
1067 %t8 = alloca %opaquety*
1068 ; CHECK: %t8 = alloca %opaquety*
1069 %t9 = alloca <4 x i32>
1070 ; CHECK: %t9 = alloca <4 x i32>
1071 %t10 = alloca <vscale x 4 x i32>
1072 ; CHECK: %t10 = alloca <vscale x 4 x i32>
1077 declare void @llvm.token(token)
1078 ; CHECK: declare void @llvm.token(token)
1080 ;; Inline Assembler Expressions
1081 define void @inlineasm(i32 %arg) {
1082 call i32 asm "bswap $0", "=r,r"(i32 %arg)
1083 ; CHECK: call i32 asm "bswap $0", "=r,r"(i32 %arg)
1084 call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
1085 ; CHECK: call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
1091 ; Instructions -- Terminators
1092 define void @instructions.terminators(i8 %val) personality i32 -10 {
1093 br i1 false, label %iftrue, label %iffalse
1094 ; CHECK: br i1 false, label %iftrue, label %iffalse
1096 ; CHECK: br label %iftrue
1102 switch i8 %val, label %defaultdest [
1103 ; CHECK: switch i8 %val, label %defaultdest [
1104 i8 0, label %defaultdest.0
1105 ; CHECK: i8 0, label %defaultdest.0
1106 i8 1, label %defaultdest.1
1107 ; CHECK: i8 1, label %defaultdest.1
1108 i8 2, label %defaultdest.2
1109 ; CHECK: i8 2, label %defaultdest.2
1120 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
1121 ; CHECK: indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
1122 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
1123 ; CHECK: indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
1125 invoke fastcc void @f.fastcc()
1126 ; CHECK: invoke fastcc void @f.fastcc()
1127 to label %defaultdest unwind label %exc
1128 ; CHECK: to label %defaultdest unwind label %exc
1130 %cleanup = landingpad i32 cleanup
1133 ; CHECK: resume i32 undef
1135 ; CHECK: resume i32 poison
1137 ; CHECK: unreachable
1142 define i32 @instructions.win_eh.1() personality i32 -3 {
1146 invoke void @f.ccc() to label %normal unwind label %catchswitch1
1147 invoke void @f.ccc() to label %normal unwind label %catchswitch2
1148 invoke void @f.ccc() to label %normal unwind label %catchswitch3
1151 %cs1 = catchswitch within none [label %catchpad1] unwind to caller
1154 catchpad within %cs1 []
1156 ; CHECK: catchpad within %cs1 []
1157 ; CHECK-NEXT: br label %normal
1160 %cs2 = catchswitch within none [label %catchpad2] unwind to caller
1163 catchpad within %cs2 [i32* %arg1]
1165 ; CHECK: catchpad within %cs2 [i32* %arg1]
1166 ; CHECK-NEXT: br label %normal
1169 %cs3 = catchswitch within none [label %catchpad3] unwind label %cleanuppad1
1172 catchpad within %cs3 [i32* %arg1, i32* %arg2]
1174 ; CHECK: catchpad within %cs3 [i32* %arg1, i32* %arg2]
1175 ; CHECK-NEXT: br label %normal
1178 %clean.1 = cleanuppad within none []
1180 ; CHECK: %clean.1 = cleanuppad within none []
1181 ; CHECK-NEXT: unreachable
1187 define i32 @instructions.win_eh.2() personality i32 -4 {
1189 invoke void @f.ccc() to label %invoke.cont unwind label %catchswitch
1192 invoke void @f.ccc() to label %continue unwind label %cleanup
1195 %clean = cleanuppad within none []
1196 ; CHECK: %clean = cleanuppad within none []
1197 cleanupret from %clean unwind to caller
1198 ; CHECK: cleanupret from %clean unwind to caller
1201 %cs = catchswitch within none [label %catchpad] unwind label %terminate
1204 %catch = catchpad within %cs []
1206 ; CHECK: %catch = catchpad within %cs []
1207 ; CHECK-NEXT: br label %body
1210 invoke void @f.ccc() [ "funclet"(token %catch) ]
1211 to label %continue unwind label %terminate.inner
1212 catchret from %catch to label %return
1213 ; CHECK: catchret from %catch to label %return
1219 cleanuppad within %catch []
1221 ; CHECK: cleanuppad within %catch []
1222 ; CHECK-NEXT: unreachable
1225 cleanuppad within none []
1227 ; CHECK: cleanuppad within none []
1228 ; CHECK-NEXT: unreachable
1234 ; Instructions -- Unary Operations
1235 define void @instructions.unops(double %op1) {
1237 ; CHECK: fneg double %op1
1241 ; Instructions -- Binary Operations
1242 define void @instructions.binops(i8 %op1, i8 %op2) {
1245 ; CHECK: add i8 %op1, %op2
1246 add nuw i8 %op1, %op2
1247 ; CHECK: add nuw i8 %op1, %op2
1248 add nsw i8 %op1, %op2
1249 ; CHECK: add nsw i8 %op1, %op2
1250 add nuw nsw i8 %op1, %op2
1251 ; CHECK: add nuw nsw i8 %op1, %op2
1253 ; CHECK: sub i8 %op1, %op2
1254 sub nuw i8 %op1, %op2
1255 ; CHECK: sub nuw i8 %op1, %op2
1256 sub nsw i8 %op1, %op2
1257 ; CHECK: sub nsw i8 %op1, %op2
1258 sub nuw nsw i8 %op1, %op2
1259 ; CHECK: sub nuw nsw i8 %op1, %op2
1261 ; CHECK: mul i8 %op1, %op2
1262 mul nuw i8 %op1, %op2
1263 ; CHECK: mul nuw i8 %op1, %op2
1264 mul nsw i8 %op1, %op2
1265 ; CHECK: mul nsw i8 %op1, %op2
1266 mul nuw nsw i8 %op1, %op2
1267 ; CHECK: mul nuw nsw i8 %op1, %op2
1271 ; CHECK: udiv i8 %op1, %op2
1272 udiv exact i8 %op1, %op2
1273 ; CHECK: udiv exact i8 %op1, %op2
1275 ; CHECK: sdiv i8 %op1, %op2
1276 sdiv exact i8 %op1, %op2
1277 ; CHECK: sdiv exact i8 %op1, %op2
1281 ; CHECK: urem i8 %op1, %op2
1283 ; CHECK: srem i8 %op1, %op2
1288 ; Instructions -- Bitwise Binary Operations
1289 define void @instructions.bitwise_binops(i8 %op1, i8 %op2) {
1292 ; CHECK: shl i8 %op1, %op2
1293 shl nuw i8 %op1, %op2
1294 ; CHECK: shl nuw i8 %op1, %op2
1295 shl nsw i8 %op1, %op2
1296 ; CHECK: shl nsw i8 %op1, %op2
1297 shl nuw nsw i8 %op1, %op2
1298 ; CHECK: shl nuw nsw i8 %op1, %op2
1302 ; CHECK: lshr i8 %op1, %op2
1303 lshr exact i8 %op1, %op2
1304 ; CHECK: lshr exact i8 %op1, %op2
1306 ; CHECK: ashr i8 %op1, %op2
1307 ashr exact i8 %op1, %op2
1308 ; CHECK: ashr exact i8 %op1, %op2
1312 ; CHECK: and i8 %op1, %op2
1314 ; CHECK: or i8 %op1, %op2
1316 ; CHECK: xor i8 %op1, %op2
1321 ; Instructions -- Vector Operations
1322 define void @instructions.vectorops(<4 x float> %vec, <4 x float> %vec2) {
1323 extractelement <4 x float> %vec, i8 0
1324 ; CHECK: extractelement <4 x float> %vec, i8 0
1325 insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1326 ; CHECK: insertelement <4 x float> %vec, float 3.500000e+00, i8 0
1327 shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1328 ; CHECK: shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
1333 ; Instructions -- Aggregate Operations
1334 define void @instructions.aggregateops({ i8, i32 } %up, <{ i8, i32 }> %p,
1335 [3 x i8] %arr, { i8, { i32 }} %n,
1336 <2 x i8*> %pvec, <2 x i64> %offsets) {
1337 extractvalue { i8, i32 } %up, 0
1338 ; CHECK: extractvalue { i8, i32 } %up, 0
1339 extractvalue <{ i8, i32 }> %p, 1
1340 ; CHECK: extractvalue <{ i8, i32 }> %p, 1
1341 extractvalue [3 x i8] %arr, 2
1342 ; CHECK: extractvalue [3 x i8] %arr, 2
1343 extractvalue { i8, { i32 } } %n, 1, 0
1344 ; CHECK: extractvalue { i8, { i32 } } %n, 1, 0
1346 insertvalue { i8, i32 } %up, i8 1, 0
1347 ; CHECK: insertvalue { i8, i32 } %up, i8 1, 0
1348 insertvalue <{ i8, i32 }> %p, i32 2, 1
1349 ; CHECK: insertvalue <{ i8, i32 }> %p, i32 2, 1
1350 insertvalue [3 x i8] %arr, i8 0, 0
1351 ; CHECK: insertvalue [3 x i8] %arr, i8 0, 0
1352 insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1353 ; CHECK: insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1355 %up.ptr = alloca { i8, i32 }
1356 %p.ptr = alloca <{ i8, i32 }>
1357 %arr.ptr = alloca [3 x i8]
1358 %n.ptr = alloca { i8, { i32 } }
1360 getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
1361 ; CHECK: getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
1362 getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
1363 ; CHECK: getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
1364 getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
1365 ; CHECK: getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
1366 getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
1367 ; CHECK: getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
1368 getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
1369 ; CHECK: getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
1370 getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
1371 ; CHECK: getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
1376 ; Instructions -- Memory Access and Addressing Operations
1380 define void @instructions.memops(i32** %base) {
1381 alloca i32, i8 4, align 4
1382 ; CHECK: alloca i32, i8 4, align 4
1383 alloca inalloca i32, i8 4, align 4
1384 ; CHECK: alloca inalloca i32, i8 4, align 4
1386 load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1387 ; CHECK: load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1388 load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1389 ; CHECK: load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1391 store i32* null, i32** %base, align 4, !nontemporal !8
1392 ; CHECK: store i32* null, i32** %base, align 4, !nontemporal !8
1393 store volatile i32* null, i32** %base, align 4, !nontemporal !8
1394 ; CHECK: store volatile i32* null, i32** %base, align 4, !nontemporal !8
1399 ; Instructions -- Conversion Operations
1400 define void @instructions.conversions() {
1402 ; CHECK: trunc i32 -1 to i1
1404 ; CHECK: zext i32 -1 to i64
1406 ; CHECK: sext i32 -1 to i64
1407 fptrunc float undef to half
1408 ; CHECK: fptrunc float undef to half
1409 fpext half undef to float
1410 ; CHECK: fpext half undef to float
1411 fptoui float undef to i32
1412 ; CHECK: fptoui float undef to i32
1413 fptosi float undef to i32
1414 ; CHECK: fptosi float undef to i32
1415 fptrunc float poison to half
1416 ; CHECK: fptrunc float poison to half
1417 fpext half poison to float
1418 ; CHECK: fpext half poison to float
1419 fptoui float poison to i32
1420 ; CHECK: fptoui float poison to i32
1421 fptosi float poison to i32
1422 ; CHECK: fptosi float poison to i32
1423 uitofp i32 1 to float
1424 ; CHECK: uitofp i32 1 to float
1425 sitofp i32 -1 to float
1426 ; CHECK: sitofp i32 -1 to float
1427 ptrtoint i8* null to i64
1428 ; CHECK: ptrtoint i8* null to i64
1429 inttoptr i64 0 to i8*
1430 ; CHECK: inttoptr i64 0 to i8*
1431 bitcast i32 0 to i32
1432 ; CHECK: bitcast i32 0 to i32
1433 addrspacecast i32* null to i32 addrspace(1)*
1434 ; CHECK: addrspacecast i32* null to i32 addrspace(1)*
1439 ; Instructions -- Other Operations
1440 define void @instructions.other(i32 %op1, i32 %op2, half %fop1, half %fop2, <2 x i32> %vop, i8* %pop) {
1442 icmp eq i32 %op1, %op2
1443 ; CHECK: icmp eq i32 %op1, %op2
1444 icmp ne i32 %op1, %op2
1445 ; CHECK: icmp ne i32 %op1, %op2
1446 icmp ugt i32 %op1, %op2
1447 ; CHECK: icmp ugt i32 %op1, %op2
1448 icmp uge i32 %op1, %op2
1449 ; CHECK: icmp uge i32 %op1, %op2
1450 icmp ult i32 %op1, %op2
1451 ; CHECK: icmp ult i32 %op1, %op2
1452 icmp ule i32 %op1, %op2
1453 ; CHECK: icmp ule i32 %op1, %op2
1454 icmp sgt i32 %op1, %op2
1455 ; CHECK: icmp sgt i32 %op1, %op2
1456 icmp sge i32 %op1, %op2
1457 ; CHECK: icmp sge i32 %op1, %op2
1458 icmp slt i32 %op1, %op2
1459 ; CHECK: icmp slt i32 %op1, %op2
1460 icmp sle i32 %op1, %op2
1461 ; CHECK: icmp sle i32 %op1, %op2
1463 fcmp false half %fop1, %fop2
1464 ; CHECK: fcmp false half %fop1, %fop2
1465 fcmp oeq half %fop1, %fop2
1466 ; CHECK: fcmp oeq half %fop1, %fop2
1467 fcmp ogt half %fop1, %fop2
1468 ; CHECK: fcmp ogt half %fop1, %fop2
1469 fcmp oge half %fop1, %fop2
1470 ; CHECK: fcmp oge half %fop1, %fop2
1471 fcmp olt half %fop1, %fop2
1472 ; CHECK: fcmp olt half %fop1, %fop2
1473 fcmp ole half %fop1, %fop2
1474 ; CHECK: fcmp ole half %fop1, %fop2
1475 fcmp one half %fop1, %fop2
1476 ; CHECK: fcmp one half %fop1, %fop2
1477 fcmp ord half %fop1, %fop2
1478 ; CHECK: fcmp ord half %fop1, %fop2
1479 fcmp ueq half %fop1, %fop2
1480 ; CHECK: fcmp ueq half %fop1, %fop2
1481 fcmp ugt half %fop1, %fop2
1482 ; CHECK: fcmp ugt half %fop1, %fop2
1483 fcmp uge half %fop1, %fop2
1484 ; CHECK: fcmp uge half %fop1, %fop2
1485 fcmp ult half %fop1, %fop2
1486 ; CHECK: fcmp ult half %fop1, %fop2
1487 fcmp ule half %fop1, %fop2
1488 ; CHECK: fcmp ule half %fop1, %fop2
1489 fcmp une half %fop1, %fop2
1490 ; CHECK: fcmp une half %fop1, %fop2
1491 fcmp uno half %fop1, %fop2
1492 ; CHECK: fcmp uno half %fop1, %fop2
1493 fcmp true half %fop1, %fop2
1494 ; CHECK: fcmp true half %fop1, %fop2
1498 %v1 = add i32 %op1, %op2
1501 %v2 = add i32 %op1, %op2
1504 phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1505 ; CHECK: phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1507 select i1 true, i32 0, i32 1
1508 ; CHECK: select i1 true, i32 0, i32 1
1509 select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1510 ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1512 call void @f.nobuiltin() builtin
1513 ; CHECK: call void @f.nobuiltin() #46
1515 call fastcc noalias i32* @f.noalias() noinline
1516 ; CHECK: call fastcc noalias i32* @f.noalias() #12
1517 tail call ghccc nonnull i32* @f.nonnull() minsize
1518 ; CHECK: tail call ghccc nonnull i32* @f.nonnull() #7
1521 ; CHECK: freeze i32 %op1
1523 ; CHECK: freeze i32 10
1525 ; CHECK: freeze half %fop1
1526 freeze <2 x i32> %vop
1527 ; CHECK: freeze <2 x i32> %vop
1529 ; CHECK: freeze i8* %pop
1533 define void @instructions.call_musttail(i8* inalloca(i8) %val) {
1534 musttail call void @f.param.inalloca(i8* inalloca(i8) %val)
1535 ; CHECK: musttail call void @f.param.inalloca(i8* inalloca(i8) %val)
1540 define void @instructions.call_notail() {
1541 notail call void @f1()
1542 ; CHECK: notail call void @f1()
1547 define void @instructions.landingpad() personality i32 -2 {
1548 invoke void @llvm.donothing() to label %proceed unwind label %catch1
1549 invoke void @llvm.donothing() to label %proceed unwind label %catch2
1550 invoke void @llvm.donothing() to label %proceed unwind label %catch3
1551 invoke void @llvm.donothing() to label %proceed unwind label %catch4
1555 ; CHECK: landingpad i32
1562 ; CHECK: landingpad i32
1566 ; CHECK: catch i32* null
1571 ; CHECK: landingpad i32
1575 ; CHECK: catch i32* null
1577 ; CHECK: catch i32* null
1582 ; CHECK: landingpad i32
1583 filter [2 x i32] zeroinitializer
1584 ; CHECK: filter [2 x i32] zeroinitializer
1591 ;; Intrinsic Functions
1593 ; Intrinsic Functions -- Variable Argument Handling
1594 declare void @llvm.va_start(i8*)
1595 declare void @llvm.va_copy(i8*, i8*)
1596 declare void @llvm.va_end(i8*)
1597 define void @instructions.va_arg(i8* %v, ...) {
1599 %ap2 = bitcast i8** %ap to i8*
1601 call void @llvm.va_start(i8* %ap2)
1602 ; CHECK: call void @llvm.va_start(i8* %ap2)
1604 va_arg i8* %ap2, i32
1605 ; CHECK: va_arg i8* %ap2, i32
1607 call void @llvm.va_copy(i8* %v, i8* %ap2)
1608 ; CHECK: call void @llvm.va_copy(i8* %v, i8* %ap2)
1610 call void @llvm.va_end(i8* %ap2)
1611 ; CHECK: call void @llvm.va_end(i8* %ap2)
1616 ; Intrinsic Functions -- Accurate Garbage Collection
1617 declare void @llvm.gcroot(i8**, i8*)
1618 declare i8* @llvm.gcread(i8*, i8**)
1619 declare void @llvm.gcwrite(i8*, i8*, i8**)
1620 define void @intrinsics.gc() gc "shadow-stack" {
1621 %ptrloc = alloca i8*
1622 call void @llvm.gcroot(i8** %ptrloc, i8* null)
1623 ; CHECK: call void @llvm.gcroot(i8** %ptrloc, i8* null)
1625 call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1626 ; CHECK: call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1629 call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1630 ; CHECK: call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1635 ; Intrinsic Functions -- Code Generation
1636 declare i8* @llvm.returnaddress(i32)
1637 declare i8* @llvm.frameaddress(i32)
1638 declare i32 @llvm.read_register.i32(metadata)
1639 declare i64 @llvm.read_register.i64(metadata)
1640 declare void @llvm.write_register.i32(metadata, i32)
1641 declare void @llvm.write_register.i64(metadata, i64)
1642 declare i8* @llvm.stacksave()
1643 declare void @llvm.stackrestore(i8*)
1644 declare void @llvm.prefetch.p0i8(i8*, i32, i32, i32)
1645 declare void @llvm.pcmarker(i32)
1646 declare i64 @llvm.readcyclecounter()
1647 declare void @llvm.clear_cache(i8*, i8*)
1648 declare void @llvm.instrprof_increment(i8*, i64, i32, i32)
1651 define void @intrinsics.codegen() {
1652 call i8* @llvm.returnaddress(i32 1)
1653 ; CHECK: call i8* @llvm.returnaddress(i32 1)
1654 call i8* @llvm.frameaddress(i32 1)
1655 ; CHECK: call i8* @llvm.frameaddress.p0i8(i32 1)
1657 call i32 @llvm.read_register.i32(metadata !10)
1658 ; CHECK: call i32 @llvm.read_register.i32(metadata !10)
1659 call i64 @llvm.read_register.i64(metadata !10)
1660 ; CHECK: call i64 @llvm.read_register.i64(metadata !10)
1661 call void @llvm.write_register.i32(metadata !10, i32 0)
1662 ; CHECK: call void @llvm.write_register.i32(metadata !10, i32 0)
1663 call void @llvm.write_register.i64(metadata !10, i64 0)
1664 ; CHECK: call void @llvm.write_register.i64(metadata !10, i64 0)
1666 %stack = call i8* @llvm.stacksave()
1667 ; CHECK: %stack = call i8* @llvm.stacksave()
1668 call void @llvm.stackrestore(i8* %stack)
1669 ; CHECK: call void @llvm.stackrestore(i8* %stack)
1671 call void @llvm.prefetch.p0i8(i8* %stack, i32 0, i32 3, i32 0)
1672 ; CHECK: call void @llvm.prefetch.p0i8(i8* %stack, i32 0, i32 3, i32 0)
1674 call void @llvm.pcmarker(i32 1)
1675 ; CHECK: call void @llvm.pcmarker(i32 1)
1677 call i64 @llvm.readcyclecounter()
1678 ; CHECK: call i64 @llvm.readcyclecounter()
1680 call void @llvm.clear_cache(i8* null, i8* null)
1681 ; CHECK: call void @llvm.clear_cache(i8* null, i8* null)
1683 call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1684 ; CHECK: call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1689 declare void @llvm.localescape(...)
1690 declare i8* @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
1691 define void @intrinsics.localescape() {
1692 %static.alloca = alloca i32
1693 call void (...) @llvm.localescape(i32* %static.alloca)
1694 ; CHECK: call void (...) @llvm.localescape(i32* %static.alloca)
1696 call void @intrinsics.localrecover()
1700 define void @intrinsics.localrecover() {
1701 %func = bitcast void ()* @intrinsics.localescape to i8*
1702 %fp = call i8* @llvm.frameaddress(i32 1)
1703 call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1704 ; CHECK: call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1709 ; We need this function to provide `uses' for some metadata tests.
1710 define void @misc.metadata() {
1711 call void @f1(), !srcloc !11
1712 call void @f1(), !srcloc !12
1713 call void @f1(), !srcloc !13
1714 call void @f1(), !srcloc !14
1718 declare void @op_bundle_callee_0()
1719 declare void @op_bundle_callee_1(i32,i32)
1721 define void @call_with_operand_bundle0(i32* %ptr) {
1722 ; CHECK-LABEL: call_with_operand_bundle0(
1724 %l = load i32, i32* %ptr
1726 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1727 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1731 define void @call_with_operand_bundle1(i32* %ptr) {
1732 ; CHECK-LABEL: call_with_operand_bundle1(
1734 %l = load i32, i32* %ptr
1737 call void @op_bundle_callee_0()
1738 call void @op_bundle_callee_0() [ "foo"() ]
1739 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1740 ; CHECK: @op_bundle_callee_0(){{$}}
1741 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"() ]
1742 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1746 define void @call_with_operand_bundle2(i32* %ptr) {
1747 ; CHECK-LABEL: call_with_operand_bundle2(
1749 call void @op_bundle_callee_0() [ "foo"() ]
1750 ; CHECK: call void @op_bundle_callee_0() [ "foo"() ]
1754 define void @call_with_operand_bundle3(i32* %ptr) {
1755 ; CHECK-LABEL: call_with_operand_bundle3(
1757 %l = load i32, i32* %ptr
1759 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1760 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1764 define void @call_with_operand_bundle4(i32* %ptr) {
1765 ; CHECK-LABEL: call_with_operand_bundle4(
1767 %l = load i32, i32* %ptr
1769 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) ]
1770 ; 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) ]
1774 ; Invoke versions of the above tests:
1777 define void @invoke_with_operand_bundle0(i32* %ptr) personality i8 3 {
1778 ; CHECK-LABEL: @invoke_with_operand_bundle0(
1780 %l = load i32, i32* %ptr
1782 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
1783 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1786 %cleanup = landingpad i8 cleanup
1792 define void @invoke_with_operand_bundle1(i32* %ptr) personality i8 3 {
1793 ; CHECK-LABEL: @invoke_with_operand_bundle1(
1795 %l = load i32, i32* %ptr
1798 invoke void @op_bundle_callee_0() to label %normal unwind label %exception
1799 ; CHECK: invoke void @op_bundle_callee_0(){{$}}
1802 %cleanup = landingpad i8 cleanup
1806 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal1 unwind label %exception1
1807 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1810 %cleanup1 = landingpad i8 cleanup
1814 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
1815 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1818 %cleanup2 = landingpad i8 cleanup
1825 define void @invoke_with_operand_bundle2(i32* %ptr) personality i8 3 {
1826 ; CHECK-LABEL: @invoke_with_operand_bundle2(
1828 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal unwind label %exception
1829 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1832 %cleanup = landingpad i8 cleanup
1838 define void @invoke_with_operand_bundle3(i32* %ptr) personality i8 3 {
1839 ; CHECK-LABEL: @invoke_with_operand_bundle3(
1841 %l = load i32, i32* %ptr
1843 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
1844 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1847 %cleanup = landingpad i8 cleanup
1853 define void @invoke_with_operand_bundle4(i32* %ptr) personality i8 3 {
1854 ; CHECK-LABEL: @invoke_with_operand_bundle4(
1856 %l = load i32, i32* %ptr
1858 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) ]
1859 to label %normal unwind label %exception
1860 ; 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) ]
1863 %cleanup = landingpad i8 cleanup
1869 declare void @vaargs_func(...)
1870 define void @invoke_with_operand_bundle_vaarg(i32* %ptr) personality i8 3 {
1871 ; CHECK-LABEL: @invoke_with_operand_bundle_vaarg(
1873 %l = load i32, i32* %ptr
1875 invoke void (...) @vaargs_func(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1876 to label %normal unwind label %exception
1877 ; 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) ]
1880 %cleanup = landingpad i8 cleanup
1887 declare void @f.writeonly() writeonly
1888 ; CHECK: declare void @f.writeonly() #41
1890 declare void @f.speculatable() speculatable
1891 ; CHECK: declare void @f.speculatable() #42
1893 ;; Constant Expressions
1895 define i8** @constexpr() {
1896 ; CHECK: ret i8** getelementptr inbounds ({ [4 x i8*], [4 x i8*] }, { [4 x i8*], [4 x i8*] }* null, i32 0, inrange i32 1, i32 2)
1897 ret i8** getelementptr inbounds ({ [4 x i8*], [4 x i8*] }, { [4 x i8*], [4 x i8*] }* null, i32 0, inrange i32 1, i32 2)
1900 define void @instructions.strictfp() strictfp {
1901 call void @f.strictfp() strictfp
1902 ; CHECK: call void @f.strictfp() #43
1907 declare void @f.nosanitize_coverage() nosanitize_coverage
1908 ; CHECK: declare void @f.nosanitize_coverage() #44
1910 declare void @f.disable_sanitizer_instrumentation() disable_sanitizer_instrumentation
1911 ; CHECK: declare void @f.disable_sanitizer_instrumentation() #45
1914 declare void @llvm.test.immarg.intrinsic(i32 immarg)
1915 ; CHECK: declare void @llvm.test.immarg.intrinsic(i32 immarg)
1917 ; byval attribute with type
1918 %named_type = type [8 x i8]
1919 declare void @byval_type(i32* byval(i32) align 2)
1920 declare void @byval_type2({ i8, i8* }* byval({ i8, i8* }))
1921 declare void @byval_named_type(%named_type* byval(%named_type))
1922 ; CHECK: declare void @byval_type(i32* byval(i32) align 2)
1923 ; CHECK: declare void @byval_type2({ i8, i8* }* byval({ i8, i8* }))
1924 ; CHECK: declare void @byval_named_type([8 x i8]* byval([8 x i8]))
1926 ; CHECK: attributes #0 = { alignstack=4 }
1927 ; CHECK: attributes #1 = { alignstack=8 }
1928 ; CHECK: attributes #2 = { alwaysinline }
1929 ; CHECK: attributes #3 = { cold }
1930 ; CHECK: attributes #4 = { convergent }
1931 ; CHECK: attributes #5 = { inlinehint }
1932 ; CHECK: attributes #6 = { jumptable }
1933 ; CHECK: attributes #7 = { minsize }
1934 ; CHECK: attributes #8 = { naked }
1935 ; CHECK: attributes #9 = { nobuiltin }
1936 ; CHECK: attributes #10 = { noduplicate }
1937 ; CHECK: attributes #11 = { noimplicitfloat }
1938 ; CHECK: attributes #12 = { noinline }
1939 ; CHECK: attributes #13 = { nonlazybind }
1940 ; CHECK: attributes #14 = { noredzone }
1941 ; CHECK: attributes #15 = { noreturn }
1942 ; CHECK: attributes #16 = { nounwind }
1943 ; CHECK: attributes #17 = { noinline optnone }
1944 ; CHECK: attributes #18 = { optsize }
1945 ; CHECK: attributes #19 = { readnone }
1946 ; CHECK: attributes #20 = { readonly }
1947 ; CHECK: attributes #21 = { returns_twice }
1948 ; CHECK: attributes #22 = { safestack }
1949 ; CHECK: attributes #23 = { sanitize_address }
1950 ; CHECK: attributes #24 = { sanitize_memory }
1951 ; CHECK: attributes #25 = { sanitize_thread }
1952 ; CHECK: attributes #26 = { ssp }
1953 ; CHECK: attributes #27 = { sspreq }
1954 ; CHECK: attributes #28 = { sspstrong }
1955 ; CHECK: attributes #29 = { "thunk" }
1956 ; CHECK: attributes #30 = { uwtable }
1957 ; CHECK: attributes #31 = { "cpu"="cortex-a8" }
1958 ; CHECK: attributes #32 = { norecurse }
1959 ; CHECK: attributes #33 = { inaccessiblememonly }
1960 ; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly }
1961 ; CHECK: attributes #35 = { nofree nosync nounwind readnone willreturn }
1962 ; CHECK: attributes #36 = { nofree nosync nounwind willreturn }
1963 ; CHECK: attributes #37 = { argmemonly nounwind readonly }
1964 ; CHECK: attributes #38 = { argmemonly nounwind }
1965 ; CHECK: attributes #39 = { nounwind readonly }
1966 ; CHECK: attributes #40 = { inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn }
1967 ; CHECK: attributes #41 = { writeonly }
1968 ; CHECK: attributes #42 = { speculatable }
1969 ; CHECK: attributes #43 = { strictfp }
1970 ; CHECK: attributes #44 = { nosanitize_coverage }
1971 ; CHECK: attributes #45 = { disable_sanitizer_instrumentation }
1972 ; CHECK: attributes #46 = { builtin }
1976 ; Metadata -- Module flags
1977 !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1978 ; CHECK: !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1980 !0 = !{i32 1, !"mod1", i32 0}
1981 ; CHECK: !0 = !{i32 1, !"mod1", i32 0}
1982 !1 = !{i32 2, !"mod2", i32 0}
1983 ; CHECK: !1 = !{i32 2, !"mod2", i32 0}
1984 !2 = !{i32 3, !"mod3", !3}
1985 ; CHECK: !2 = !{i32 3, !"mod3", !3}
1987 ; CHECK: !3 = !{!"mod6", !0}
1988 !4 = !{i32 4, !"mod4", i32 0}
1989 ; CHECK: !4 = !{i32 4, !"mod4", i32 0}
1990 !5 = !{i32 5, !"mod5", !0}
1991 ; CHECK: !5 = !{i32 5, !"mod5", !0}
1992 !6 = !{i32 6, !"mod6", !0}
1993 ; CHECK: !6 = !{i32 6, !"mod6", !0}
1995 ; Metadata -- Check `distinct'
1997 ; CHECK: !11 = distinct !{}
1999 ; CHECK: !12 = distinct !{}
2001 ; CHECK: !13 = !{!11}
2003 ; CHECK: !14 = !{!12}