1 ; Bitcode compatibility test for llvm 3.8.0
3 ; N.b: This is 3.8-compatible IR. The CHECK lines occasionally differ from
4 ; the IR used to generate the bitcode, and may need to be updated.
6 ; RUN: llvm-dis < %s.bc | FileCheck %s
8 target datalayout = "E"
9 ; CHECK: target datalayout = "E"
11 target triple = "x86_64-apple-macosx10.10.0"
12 ; CHECK: target triple = "x86_64-apple-macosx10.10.0"
14 ;; Module-level assembly
15 module asm "beep boop"
16 ; CHECK: module asm "beep boop"
19 $comdat.any = comdat any
20 ; CHECK: $comdat.any = comdat any
21 $comdat.exactmatch = comdat exactmatch
22 ; CHECK: $comdat.exactmatch = comdat exactmatch
23 $comdat.largest = comdat largest
24 ; CHECK: $comdat.largest = comdat largest
25 $comdat.noduplicates = comdat nodeduplicate
26 ; CHECK: $comdat.noduplicates = comdat nodeduplicate
27 $comdat.samesize = comdat samesize
28 ; CHECK: $comdat.samesize = comdat samesize
31 @const.true = constant i1 true
32 ; CHECK: @const.true = constant i1 true
33 @const.false = constant i1 false
34 ; CHECK: @const.false = constant i1 false
35 @const.int = constant i32 zeroinitializer
36 ; CHECK: @const.int = constant i32 0
37 @const.float = constant double 0.0
38 ; CHECK: @const.float = constant double 0.0
39 @const.null = constant i8* null
40 ; CHECK: @const.null = constant ptr null
41 %const.struct.type = type { i32, i8 }
42 %const.struct.type.packed = type <{ i32, i8 }>
43 @const.struct = constant %const.struct.type { i32 -1, i8 undef }
44 ; CHECK: @const.struct = constant %const.struct.type { i32 -1, i8 undef }
45 @const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }>
46 ; CHECK: @const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }>
48 ; CHECK: @constant.array.i8 = constant [3 x i8] c"\00\01\00"
49 @constant.array.i8 = constant [3 x i8] [i8 -0, i8 1, i8 0]
50 ; CHECK: @constant.array.i16 = constant [3 x i16] [i16 0, i16 1, i16 0]
51 @constant.array.i16 = constant [3 x i16] [i16 -0, i16 1, i16 0]
52 ; CHECK: @constant.array.i32 = constant [3 x i32] [i32 0, i32 1, i32 0]
53 @constant.array.i32 = constant [3 x i32] [i32 -0, i32 1, i32 0]
54 ; CHECK: @constant.array.i64 = constant [3 x i64] [i64 0, i64 1, i64 0]
55 @constant.array.i64 = constant [3 x i64] [i64 -0, i64 1, i64 0]
56 ; CHECK: @constant.array.f16 = constant [3 x half] [half 0xH8000, half 0xH3C00, half 0xH0000]
57 @constant.array.f16 = constant [3 x half] [half -0.0, half 1.0, half 0.0]
58 ; CHECK: @constant.array.f32 = constant [3 x float] [float -0.000000e+00, float 1.000000e+00, float 0.000000e+00]
59 @constant.array.f32 = constant [3 x float] [float -0.0, float 1.0, float 0.0]
60 ; CHECK: @constant.array.f64 = constant [3 x double] [double -0.000000e+00, double 1.000000e+00, double 0.000000e+00]
61 @constant.array.f64 = constant [3 x double] [double -0.0, double 1.0, double 0.0]
63 ; CHECK: @constant.vector.i8 = constant <3 x i8> <i8 0, i8 1, i8 0>
64 @constant.vector.i8 = constant <3 x i8> <i8 -0, i8 1, i8 0>
65 ; CHECK: @constant.vector.i16 = constant <3 x i16> <i16 0, i16 1, i16 0>
66 @constant.vector.i16 = constant <3 x i16> <i16 -0, i16 1, i16 0>
67 ; CHECK: @constant.vector.i32 = constant <3 x i32> <i32 0, i32 1, i32 0>
68 @constant.vector.i32 = constant <3 x i32> <i32 -0, i32 1, i32 0>
69 ; CHECK: @constant.vector.i64 = constant <3 x i64> <i64 0, i64 1, i64 0>
70 @constant.vector.i64 = constant <3 x i64> <i64 -0, i64 1, i64 0>
71 ; CHECK: @constant.vector.f16 = constant <3 x half> <half 0xH8000, half 0xH3C00, half 0xH0000>
72 @constant.vector.f16 = constant <3 x half> <half -0.0, half 1.0, half 0.0>
73 ; CHECK: @constant.vector.f32 = constant <3 x float> <float -0.000000e+00, float 1.000000e+00, float 0.000000e+00>
74 @constant.vector.f32 = constant <3 x float> <float -0.0, float 1.0, float 0.0>
75 ; CHECK: @constant.vector.f64 = constant <3 x double> <double -0.000000e+00, double 1.000000e+00, double 0.000000e+00>
76 @constant.vector.f64 = constant <3 x double> <double -0.0, double 1.0, double 0.0>
79 ; Format: [@<GlobalVarName> =] [Linkage] [Visibility] [DLLStorageClass]
80 ; [ThreadLocal] [unnamed_addr] [AddrSpace] [ExternallyInitialized]
81 ; <global | constant> <Type> [<InitializerConstant>]
82 ; [, section "name"] [, comdat [($name)]] [, align <Alignment>]
84 ; Global Variables -- Simple
86 ; CHECK: @g1 = global i32 0
88 ; CHECK: @g2 = constant i32 0
90 ; Global Variables -- Linkage
91 @g.private = private global i32 0
92 ; CHECK: @g.private = private global i32 0
93 @g.internal = internal global i32 0
94 ; CHECK: @g.internal = internal global i32 0
95 @g.available_externally = available_externally global i32 0
96 ; CHECK: @g.available_externally = available_externally global i32 0
97 @g.linkonce = linkonce global i32 0
98 ; CHECK: @g.linkonce = linkonce global i32 0
99 @g.weak = weak global i32 0
100 ; CHECK: @g.weak = weak global i32 0
101 @g.common = common global i32 0
102 ; CHECK: @g.common = common global i32 0
103 @g.appending = appending global [4 x i8] c"test"
104 ; CHECK: @g.appending = appending global [4 x i8] c"test"
105 @g.extern_weak = extern_weak global i32
106 ; CHECK: @g.extern_weak = extern_weak global i32
107 @g.linkonce_odr = linkonce_odr global i32 0
108 ; CHECK: @g.linkonce_odr = linkonce_odr global i32 0
109 @g.weak_odr = weak_odr global i32 0
110 ; CHECK: @g.weak_odr = weak_odr global i32 0
111 @g.external = external global i32
112 ; CHECK: @g.external = external global i32
114 ; Global Variables -- Visibility
115 @g.default = default global i32 0
116 ; CHECK: @g.default = global i32 0
117 @g.hidden = hidden global i32 0
118 ; CHECK: @g.hidden = hidden global i32 0
119 @g.protected = protected global i32 0
120 ; CHECK: @g.protected = protected global i32 0
122 ; Global Variables -- DLLStorageClass
123 @g.dlldefault = default global i32 0
124 ; CHECK: @g.dlldefault = global i32 0
125 @g.dllimport = external dllimport global i32
126 ; CHECK: @g.dllimport = external dllimport global i32
127 @g.dllexport = dllexport global i32 0
128 ; CHECK: @g.dllexport = dllexport global i32 0
130 ; Global Variables -- ThreadLocal
131 @g.notthreadlocal = global i32 0
132 ; CHECK: @g.notthreadlocal = global i32 0
133 @g.generaldynamic = thread_local global i32 0
134 ; CHECK: @g.generaldynamic = thread_local global i32 0
135 @g.localdynamic = thread_local(localdynamic) global i32 0
136 ; CHECK: @g.localdynamic = thread_local(localdynamic) global i32 0
137 @g.initialexec = thread_local(initialexec) global i32 0
138 ; CHECK: @g.initialexec = thread_local(initialexec) global i32 0
139 @g.localexec = thread_local(localexec) global i32 0
140 ; CHECK: @g.localexec = thread_local(localexec) global i32 0
142 ; Global Variables -- unnamed_addr
143 @g.unnamed_addr = unnamed_addr global i32 0
144 ; CHECK: @g.unnamed_addr = unnamed_addr global i32 0
146 ; Global Variables -- AddrSpace
147 @g.addrspace = addrspace(1) global i32 0
148 ; CHECK: @g.addrspace = addrspace(1) global i32 0
150 ; Global Variables -- ExternallyInitialized
151 @g.externally_initialized = external externally_initialized global i32
152 ; CHECK: @g.externally_initialized = external externally_initialized global i32
154 ; Global Variables -- section
155 @g.section = global i32 0, section "_DATA"
156 ; CHECK: @g.section = global i32 0, section "_DATA"
158 ; Global Variables -- comdat
159 @comdat.any = global i32 0, comdat
160 ; CHECK: @comdat.any = global i32 0, comdat
161 @comdat.exactmatch = global i32 0, comdat
162 ; CHECK: @comdat.exactmatch = global i32 0, comdat
163 @comdat.largest = global i32 0, comdat
164 ; CHECK: @comdat.largest = global i32 0, comdat
165 @comdat.noduplicates = global i32 0, comdat
166 ; CHECK: @comdat.noduplicates = global i32 0, comdat
167 @comdat.samesize = global i32 0, comdat
168 ; CHECK: @comdat.samesize = global i32 0, comdat
170 ; Force two globals from different comdats into sections with the same name.
171 $comdat1 = comdat any
172 $comdat2 = comdat any
173 @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
174 ; CHECK: @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
175 @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
176 ; CHECK: @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
178 ; Global Variables -- align
179 @g.align = global i32 0, align 4
180 ; CHECK: @g.align = global i32 0, align 4
182 ; Global Variables -- Intrinsics
183 %pri.func.data = type { i32, void ()*, i8* }
184 @g.used1 = global i32 0
185 @g.used2 = global i32 0
186 @g.used3 = global i8 0
188 @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
189 ; CHECK: @llvm.used = appending global [1 x ptr] [ptr @g.used1], section "llvm.metadata"
190 @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
191 ; CHECK: @llvm.compiler.used = appending global [1 x ptr] [ptr @g.used2], section "llvm.metadata"
192 @llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
193 ; 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"
194 @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
195 ; 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"
198 ; Format: @<Name> = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
199 ; [unnamed_addr] alias <AliaseeTy> @<Aliasee>
202 @a.private = private alias i32, i32* @g.private
203 ; CHECK: @a.private = private alias i32, ptr @g.private
204 @a.internal = internal alias i32, i32* @g.internal
205 ; CHECK: @a.internal = internal alias i32, ptr @g.internal
206 @a.linkonce = linkonce alias i32, i32* @g.linkonce
207 ; CHECK: @a.linkonce = linkonce alias i32, ptr @g.linkonce
208 @a.weak = weak alias i32, i32* @g.weak
209 ; CHECK: @a.weak = weak alias i32, ptr @g.weak
210 @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
211 ; CHECK: @a.linkonce_odr = linkonce_odr alias i32, ptr @g.linkonce_odr
212 @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
213 ; CHECK: @a.weak_odr = weak_odr alias i32, ptr @g.weak_odr
214 @a.external = external alias i32, i32* @g1
215 ; CHECK: @a.external = alias i32, ptr @g1
217 ; Aliases -- Visibility
218 @a.default = default alias i32, i32* @g.default
219 ; CHECK: @a.default = alias i32, ptr @g.default
220 @a.hidden = hidden alias i32, i32* @g.hidden
221 ; CHECK: @a.hidden = hidden alias i32, ptr @g.hidden
222 @a.protected = protected alias i32, i32* @g.protected
223 ; CHECK: @a.protected = protected alias i32, ptr @g.protected
225 ; Aliases -- DLLStorageClass
226 @a.dlldefault = default alias i32, i32* @g.dlldefault
227 ; CHECK: @a.dlldefault = alias i32, ptr @g.dlldefault
228 @a.dllimport = dllimport alias i32, i32* @g1
229 ; CHECK: @a.dllimport = dllimport alias i32, ptr @g1
230 @a.dllexport = dllexport alias i32, i32* @g.dllexport
231 ; CHECK: @a.dllexport = dllexport alias i32, ptr @g.dllexport
233 ; Aliases -- ThreadLocal
234 @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
235 ; CHECK: @a.notthreadlocal = alias i32, ptr @g.notthreadlocal
236 @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
237 ; CHECK: @a.generaldynamic = thread_local alias i32, ptr @g.generaldynamic
238 @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
239 ; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, ptr @g.localdynamic
240 @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
241 ; CHECK: @a.initialexec = thread_local(initialexec) alias i32, ptr @g.initialexec
242 @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
243 ; CHECK: @a.localexec = thread_local(localexec) alias i32, ptr @g.localexec
245 ; Aliases -- unnamed_addr
246 @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
247 ; CHECK: @a.unnamed_addr = unnamed_addr alias i32, ptr @g.unnamed_addr
250 ; Format: define [linkage] [visibility] [DLLStorageClass]
251 ; [cconv] [ret attrs]
252 ; <ResultType> @<FunctionName> ([argument list])
253 ; [unnamed_addr] [fn Attrs] [section "name"] [comdat [($name)]]
254 ; [align N] [gc] [prefix Constant] [prologue Constant]
255 ; [personality Constant] { ... }
257 ; Functions -- Simple
259 ; CHECK: declare void @f1()
262 ; CHECK: define void @f2()
267 ; Functions -- linkage
268 define private void @f.private() {
269 ; CHECK: define private void @f.private()
273 define internal void @f.internal() {
274 ; CHECK: define internal void @f.internal()
278 define available_externally void @f.available_externally() {
279 ; CHECK: define available_externally void @f.available_externally()
283 define linkonce void @f.linkonce() {
284 ; CHECK: define linkonce void @f.linkonce()
288 define weak void @f.weak() {
289 ; CHECK: define weak void @f.weak()
293 define linkonce_odr void @f.linkonce_odr() {
294 ; CHECK: define linkonce_odr void @f.linkonce_odr()
298 define weak_odr void @f.weak_odr() {
299 ; CHECK: define weak_odr void @f.weak_odr()
303 declare external void @f.external()
304 ; CHECK: declare void @f.external()
305 declare extern_weak void @f.extern_weak()
306 ; CHECK: declare extern_weak void @f.extern_weak()
308 ; Functions -- visibility
309 declare default void @f.default()
310 ; CHECK: declare void @f.default()
311 declare hidden void @f.hidden()
312 ; CHECK: declare hidden void @f.hidden()
313 declare protected void @f.protected()
314 ; CHECK: declare protected void @f.protected()
316 ; Functions -- DLLStorageClass
317 declare dllimport void @f.dllimport()
318 ; CHECK: declare dllimport void @f.dllimport()
319 declare dllexport void @f.dllexport()
320 ; CHECK: declare dllexport void @f.dllexport()
322 ; Functions -- cconv (Calling conventions)
323 declare ccc void @f.ccc()
324 ; CHECK: declare void @f.ccc()
325 declare fastcc void @f.fastcc()
326 ; CHECK: declare fastcc void @f.fastcc()
327 declare coldcc void @f.coldcc()
328 ; CHECK: declare coldcc void @f.coldcc()
329 declare cc10 void @f.cc10()
330 ; CHECK: declare ghccc void @f.cc10()
331 declare ghccc void @f.ghccc()
332 ; CHECK: declare ghccc void @f.ghccc()
333 declare cc11 void @f.cc11()
334 ; CHECK: declare cc11 void @f.cc11()
335 declare anyregcc void @f.anyregcc()
336 ; CHECK: declare anyregcc void @f.anyregcc()
337 declare preserve_mostcc void @f.preserve_mostcc()
338 ; CHECK: declare preserve_mostcc void @f.preserve_mostcc()
339 declare preserve_allcc void @f.preserve_allcc()
340 ; CHECK: declare preserve_allcc void @f.preserve_allcc()
341 declare cc64 void @f.cc64()
342 ; CHECK: declare x86_stdcallcc void @f.cc64()
343 declare x86_stdcallcc void @f.x86_stdcallcc()
344 ; CHECK: declare x86_stdcallcc void @f.x86_stdcallcc()
345 declare cc65 void @f.cc65()
346 ; CHECK: declare x86_fastcallcc void @f.cc65()
347 declare x86_fastcallcc void @f.x86_fastcallcc()
348 ; CHECK: declare x86_fastcallcc void @f.x86_fastcallcc()
349 declare cc66 void @f.cc66()
350 ; CHECK: declare arm_apcscc void @f.cc66()
351 declare arm_apcscc void @f.arm_apcscc()
352 ; CHECK: declare arm_apcscc void @f.arm_apcscc()
353 declare cc67 void @f.cc67()
354 ; CHECK: declare arm_aapcscc void @f.cc67()
355 declare arm_aapcscc void @f.arm_aapcscc()
356 ; CHECK: declare arm_aapcscc void @f.arm_aapcscc()
357 declare cc68 void @f.cc68()
358 ; CHECK: declare arm_aapcs_vfpcc void @f.cc68()
359 declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
360 ; CHECK: declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
361 declare cc69 void @f.cc69()
362 ; CHECK: declare msp430_intrcc void @f.cc69()
363 declare msp430_intrcc void @f.msp430_intrcc()
364 ; CHECK: declare msp430_intrcc void @f.msp430_intrcc()
365 declare cc70 void @f.cc70()
366 ; CHECK: declare x86_thiscallcc void @f.cc70()
367 declare x86_thiscallcc void @f.x86_thiscallcc()
368 ; CHECK: declare x86_thiscallcc void @f.x86_thiscallcc()
369 declare cc71 void @f.cc71()
370 ; CHECK: declare ptx_kernel void @f.cc71()
371 declare ptx_kernel void @f.ptx_kernel()
372 ; CHECK: declare ptx_kernel void @f.ptx_kernel()
373 declare cc72 void @f.cc72()
374 ; CHECK: declare ptx_device void @f.cc72()
375 declare ptx_device void @f.ptx_device()
376 ; CHECK: declare ptx_device void @f.ptx_device()
377 declare cc75 void @f.cc75()
378 ; CHECK: declare spir_func void @f.cc75()
379 declare spir_func void @f.spir_func()
380 ; CHECK: declare spir_func void @f.spir_func()
381 declare cc76 void @f.cc76()
382 ; CHECK: declare spir_kernel void @f.cc76()
383 declare spir_kernel void @f.spir_kernel()
384 ; CHECK: declare spir_kernel void @f.spir_kernel()
385 declare cc77 void @f.cc77()
386 ; CHECK: declare intel_ocl_bicc void @f.cc77()
387 declare intel_ocl_bicc void @f.intel_ocl_bicc()
388 ; CHECK: declare intel_ocl_bicc void @f.intel_ocl_bicc()
389 declare cc78 void @f.cc78()
390 ; CHECK: declare x86_64_sysvcc void @f.cc78()
391 declare x86_64_sysvcc void @f.x86_64_sysvcc()
392 ; CHECK: declare x86_64_sysvcc void @f.x86_64_sysvcc()
393 declare cc79 void @f.cc79()
394 ; CHECK: declare win64cc void @f.cc79()
395 declare win64cc void @f.x86_64_win64cc()
396 ; CHECK: declare win64cc void @f.x86_64_win64cc()
397 declare cc80 void @f.cc80()
398 ; CHECK: declare x86_vectorcallcc void @f.cc80()
399 declare x86_vectorcallcc void @f.x86_vectorcallcc()
400 ; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc()
401 declare cc1023 void @f.cc1023()
402 ; CHECK: declare cc1023 void @f.cc1023()
404 ; Functions -- ret attrs (Return attributes)
405 declare zeroext i64 @f.zeroext()
406 ; CHECK: declare zeroext i64 @f.zeroext()
407 declare signext i64 @f.signext()
408 ; CHECK: declare signext i64 @f.signext()
409 declare inreg i32* @f.inreg()
410 ; CHECK: declare inreg ptr @f.inreg()
411 declare noalias i32* @f.noalias()
412 ; CHECK: declare noalias ptr @f.noalias()
413 declare nonnull i32* @f.nonnull()
414 ; CHECK: declare nonnull ptr @f.nonnull()
415 declare dereferenceable(4) i32* @f.dereferenceable4()
416 ; CHECK: declare dereferenceable(4) ptr @f.dereferenceable4()
417 declare dereferenceable(8) i32* @f.dereferenceable8()
418 ; CHECK: declare dereferenceable(8) ptr @f.dereferenceable8()
419 declare dereferenceable(16) i32* @f.dereferenceable16()
420 ; CHECK: declare dereferenceable(16) ptr @f.dereferenceable16()
421 declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
422 ; CHECK: declare dereferenceable_or_null(4) ptr @f.dereferenceable4_or_null()
423 declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
424 ; CHECK: declare dereferenceable_or_null(8) ptr @f.dereferenceable8_or_null()
425 declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
426 ; CHECK: declare dereferenceable_or_null(16) ptr @f.dereferenceable16_or_null()
428 ; Functions -- Parameter attributes
429 declare void @f.param.zeroext(i8 zeroext)
430 ; CHECK: declare void @f.param.zeroext(i8 zeroext)
431 declare void @f.param.signext(i8 signext)
432 ; CHECK: declare void @f.param.signext(i8 signext)
433 declare void @f.param.inreg(i8 inreg)
434 ; CHECK: declare void @f.param.inreg(i8 inreg)
435 declare void @f.param.byval({ i8, i8 }* byval({ i8, i8 }))
436 ; CHECK: declare void @f.param.byval(ptr byval({ i8, i8 }))
437 declare void @f.param.inalloca(i8* inalloca)
438 ; CHECK: declare void @f.param.inalloca(ptr inalloca(i8))
439 declare void @f.param.sret(i8* sret(i8))
440 ; CHECK: declare void @f.param.sret(ptr sret(i8))
441 declare void @f.param.noalias(i8* noalias)
442 ; CHECK: declare void @f.param.noalias(ptr noalias)
443 declare void @f.param.nocapture(i8* nocapture)
444 ; CHECK: declare void @f.param.nocapture(ptr nocapture)
445 declare void @f.param.nest(i8* nest)
446 ; CHECK: declare void @f.param.nest(ptr nest)
447 declare i8* @f.param.returned(i8* returned)
448 ; CHECK: declare ptr @f.param.returned(ptr returned)
449 declare void @f.param.nonnull(i8* nonnull)
450 ; CHECK: declare void @f.param.nonnull(ptr nonnull)
451 declare void @f.param.dereferenceable(i8* dereferenceable(4))
452 ; CHECK: declare void @f.param.dereferenceable(ptr dereferenceable(4))
453 declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
454 ; CHECK: declare void @f.param.dereferenceable_or_null(ptr dereferenceable_or_null(4))
456 ; Functions -- unnamed_addr
457 declare void @f.unnamed_addr() unnamed_addr
458 ; CHECK: declare void @f.unnamed_addr() unnamed_addr
460 ; Functions -- fn Attrs (Function attributes)
461 declare void @f.alignstack4() alignstack(4)
462 ; CHECK: declare void @f.alignstack4() #0
463 declare void @f.alignstack8() alignstack(8)
464 ; CHECK: declare void @f.alignstack8() #1
465 declare void @f.alwaysinline() alwaysinline
466 ; CHECK: declare void @f.alwaysinline() #2
467 declare void @f.cold() cold
468 ; CHECK: declare void @f.cold() #3
469 declare void @f.convergent() convergent
470 ; CHECK: declare void @f.convergent() #4
471 declare void @f.inlinehint() inlinehint
472 ; CHECK: declare void @f.inlinehint() #5
473 declare void @f.jumptable() unnamed_addr jumptable
474 ; CHECK: declare void @f.jumptable() unnamed_addr #6
475 declare void @f.minsize() minsize
476 ; CHECK: declare void @f.minsize() #7
477 declare void @f.naked() naked
478 ; CHECK: declare void @f.naked() #8
479 declare void @f.nobuiltin() nobuiltin
480 ; CHECK: declare void @f.nobuiltin() #9
481 declare void @f.noduplicate() noduplicate
482 ; CHECK: declare void @f.noduplicate() #10
483 declare void @f.noimplicitfloat() noimplicitfloat
484 ; CHECK: declare void @f.noimplicitfloat() #11
485 declare void @f.noinline() noinline
486 ; CHECK: declare void @f.noinline() #12
487 declare void @f.nonlazybind() nonlazybind
488 ; CHECK: declare void @f.nonlazybind() #13
489 declare void @f.noredzone() noredzone
490 ; CHECK: declare void @f.noredzone() #14
491 declare void @f.noreturn() noreturn
492 ; CHECK: declare void @f.noreturn() #15
493 declare void @f.nounwind() nounwind
494 ; CHECK: declare void @f.nounwind() #16
495 declare void @f.optnone() noinline optnone
496 ; CHECK: declare void @f.optnone() #17
497 declare void @f.optsize() optsize
498 ; CHECK: declare void @f.optsize() #18
499 declare void @f.readnone() readnone
500 ; CHECK: declare void @f.readnone() #19
501 declare void @f.readonly() readonly
502 ; CHECK: declare void @f.readonly() #20
503 declare void @f.returns_twice() returns_twice
504 ; CHECK: declare void @f.returns_twice() #21
505 declare void @f.safestack() safestack
506 ; CHECK: declare void @f.safestack() #22
507 declare void @f.sanitize_address() sanitize_address
508 ; CHECK: declare void @f.sanitize_address() #23
509 declare void @f.sanitize_memory() sanitize_memory
510 ; CHECK: declare void @f.sanitize_memory() #24
511 declare void @f.sanitize_thread() sanitize_thread
512 ; CHECK: declare void @f.sanitize_thread() #25
513 declare void @f.ssp() ssp
514 ; CHECK: declare void @f.ssp() #26
515 declare void @f.sspreq() sspreq
516 ; CHECK: declare void @f.sspreq() #27
517 declare void @f.sspstrong() sspstrong
518 ; CHECK: declare void @f.sspstrong() #28
519 declare void @f.thunk() "thunk"
520 ; CHECK: declare void @f.thunk() #29
521 declare void @f.uwtable() uwtable
522 ; CHECK: declare void @f.uwtable() #30
523 declare void @f.kvpair() "cpu"="cortex-a8"
524 ; CHECK:declare void @f.kvpair() #31
525 declare void @f.norecurse() norecurse
526 ; CHECK: declare void @f.norecurse() #32
527 declare void @f.inaccessiblememonly() inaccessiblememonly
528 ; CHECK: declare void @f.inaccessiblememonly() #33
529 declare void @f.inaccessiblemem_or_argmemonly() inaccessiblemem_or_argmemonly
530 ; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #34
532 ; Functions -- section
533 declare void @f.section() section "80"
534 ; CHECK: declare void @f.section() section "80"
536 ; Functions -- comdat
537 define void @f.comdat_any() comdat($comdat.any) {
538 ; CHECK: define void @f.comdat_any() comdat($comdat.any)
542 define void @f.comdat_exactmatch() comdat($comdat.exactmatch) {
543 ; CHECK: define void @f.comdat_exactmatch() comdat($comdat.exactmatch)
547 define void @f.comdat_largest() comdat($comdat.largest) {
548 ; CHECK: define void @f.comdat_largest() comdat($comdat.largest)
552 define void @f.comdat_noduplicates() comdat($comdat.noduplicates) {
553 ; CHECK: define void @f.comdat_noduplicates() comdat($comdat.noduplicates)
557 define void @f.comdat_samesize() comdat($comdat.samesize) {
558 ; CHECK: define void @f.comdat_samesize() comdat($comdat.samesize)
564 declare void @f.align2() align 2
565 ; CHECK: declare void @f.align2() align 2
566 declare void @f.align4() align 4
567 ; CHECK: declare void @f.align4() align 4
568 declare void @f.align8() align 8
569 ; CHECK: declare void @f.align8() align 8
572 declare void @f.gcshadow() gc "shadow-stack"
573 ; CHECK: declare void @f.gcshadow() gc "shadow-stack"
575 ; Functions -- Prefix data
576 declare void @f.prefixi32() prefix i32 1684365668
577 ; CHECK: declare void @f.prefixi32() prefix i32 1684365668
578 declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
579 ; CHECK: declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
581 ; Functions -- Prologue data
582 declare void @f.prologuei32() prologue i32 1684365669
583 ; CHECK: declare void @f.prologuei32() prologue i32 1684365669
584 declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
585 ; CHECK: declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
587 ; Functions -- Personality constant
588 declare void @llvm.donothing() nounwind readnone
589 ; CHECK: declare void @llvm.donothing() #35
590 define void @f.no_personality() personality i8 3 {
591 ; CHECK: define void @f.no_personality() personality i8 3
592 invoke void @llvm.donothing() to label %normal unwind label %exception
594 %cleanup = landingpad i8 cleanup
600 declare i32 @f.personality_handler()
601 ; CHECK: declare i32 @f.personality_handler()
602 define void @f.personality() personality i32 ()* @f.personality_handler {
603 ; CHECK: define void @f.personality() personality ptr @f.personality_handler
604 invoke void @llvm.donothing() to label %normal unwind label %exception
606 %cleanup = landingpad i32 cleanup
612 ;; Atomic Memory Ordering Constraints
613 define void @atomics(i32* %word) {
614 %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
615 ; CHECK: %cmpxchg.0 = cmpxchg ptr %word, i32 0, i32 4 monotonic monotonic
616 %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
617 ; CHECK: %cmpxchg.1 = cmpxchg ptr %word, i32 0, i32 5 acq_rel monotonic
618 %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
619 ; CHECK: %cmpxchg.2 = cmpxchg ptr %word, i32 0, i32 6 acquire monotonic
620 %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
621 ; CHECK: %cmpxchg.3 = cmpxchg ptr %word, i32 0, i32 7 release monotonic
622 %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
623 ; CHECK: %cmpxchg.4 = cmpxchg ptr %word, i32 0, i32 8 seq_cst monotonic
624 %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
625 ; CHECK: %cmpxchg.5 = cmpxchg weak ptr %word, i32 0, i32 9 seq_cst monotonic
626 %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
627 ; CHECK: %cmpxchg.6 = cmpxchg volatile ptr %word, i32 0, i32 10 seq_cst monotonic
628 %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
629 ; CHECK: %cmpxchg.7 = cmpxchg weak volatile ptr %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic
630 %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
631 ; CHECK: %atomicrmw.xchg = atomicrmw xchg ptr %word, i32 12 monotonic
632 %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic
633 ; CHECK: %atomicrmw.add = atomicrmw add ptr %word, i32 13 monotonic
634 %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic
635 ; CHECK: %atomicrmw.sub = atomicrmw sub ptr %word, i32 14 monotonic
636 %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic
637 ; CHECK: %atomicrmw.and = atomicrmw and ptr %word, i32 15 monotonic
638 %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic
639 ; CHECK: %atomicrmw.nand = atomicrmw nand ptr %word, i32 16 monotonic
640 %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic
641 ; CHECK: %atomicrmw.or = atomicrmw or ptr %word, i32 17 monotonic
642 %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic
643 ; CHECK: %atomicrmw.xor = atomicrmw xor ptr %word, i32 18 monotonic
644 %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic
645 ; CHECK: %atomicrmw.max = atomicrmw max ptr %word, i32 19 monotonic
646 %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic
647 ; CHECK: %atomicrmw.min = atomicrmw volatile min ptr %word, i32 20 monotonic
648 %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic
649 ; CHECK: %atomicrmw.umax = atomicrmw umax ptr %word, i32 21 syncscope("singlethread") monotonic
650 %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic
651 ; CHECK: %atomicrmw.umin = atomicrmw volatile umin ptr %word, i32 22 syncscope("singlethread") monotonic
653 ; CHECK: fence acquire
655 ; CHECK: fence release
657 ; CHECK: fence acq_rel
658 fence syncscope("singlethread") seq_cst
659 ; CHECK: fence syncscope("singlethread") seq_cst
661 %ld.1 = load atomic i32, i32* %word monotonic, align 4
662 ; CHECK: %ld.1 = load atomic i32, ptr %word monotonic, align 4
663 %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
664 ; CHECK: %ld.2 = load atomic volatile i32, ptr %word acquire, align 8
665 %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16
666 ; CHECK: %ld.3 = load atomic volatile i32, ptr %word syncscope("singlethread") seq_cst, align 16
668 store atomic i32 23, i32* %word monotonic, align 4
669 ; CHECK: store atomic i32 23, ptr %word monotonic, align 4
670 store atomic volatile i32 24, i32* %word monotonic, align 4
671 ; CHECK: store atomic volatile i32 24, ptr %word monotonic, align 4
672 store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4
673 ; CHECK: store atomic volatile i32 25, ptr %word syncscope("singlethread") monotonic, align 4
678 define void @fastmathflags(float %op1, float %op2) {
679 %f.nnan = fadd nnan float %op1, %op2
680 ; CHECK: %f.nnan = fadd nnan float %op1, %op2
681 %f.ninf = fadd ninf float %op1, %op2
682 ; CHECK: %f.ninf = fadd ninf float %op1, %op2
683 %f.nsz = fadd nsz float %op1, %op2
684 ; CHECK: %f.nsz = fadd nsz float %op1, %op2
685 %f.arcp = fadd arcp float %op1, %op2
686 ; CHECK: %f.arcp = fadd arcp float %op1, %op2
687 %f.fast = fadd fast float %op1, %op2
688 ; CHECK: %f.fast = fadd fast float %op1, %op2
692 ; Check various fast math flags and floating-point types on calls.
694 declare float @fmf1()
695 declare double @fmf2()
696 declare <4 x double> @fmf3()
698 ; CHECK-LABEL: fastMathFlagsForCalls(
699 define void @fastMathFlagsForCalls(float %f, double %d1, <4 x double> %d2) {
700 %call.fast = call fast float @fmf1()
701 ; CHECK: %call.fast = call fast float @fmf1()
703 ; Throw in some other attributes to make sure those stay in the right places.
705 %call.nsz.arcp = notail call nsz arcp double @fmf2()
706 ; CHECK: %call.nsz.arcp = notail call nsz arcp double @fmf2()
708 %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
709 ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
715 %opaquety = type opaque
716 define void @typesystem() {
717 %p0 = bitcast i8* null to i32 (i32)*
718 ; CHECK: %p0 = bitcast ptr null to ptr
719 %p1 = bitcast i8* null to void (i8*)*
720 ; CHECK: %p1 = bitcast ptr null to ptr
721 %p2 = bitcast i8* null to i32 (i8*, ...)*
722 ; CHECK: %p2 = bitcast ptr null to ptr
723 %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
724 ; CHECK: %p3 = bitcast ptr null to ptr
725 %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
726 ; CHECK: %p4 = bitcast ptr null to ptr
727 %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
728 ; CHECK: %p5 = bitcast ptr null to ptr
730 %t0 = alloca i1942652
731 ; CHECK: %t0 = alloca i1942652
733 ; CHECK: %t1 = alloca half
735 ; CHECK: %t2 = alloca float
737 ; CHECK: %t3 = alloca double
739 ; CHECK: %t4 = alloca fp128
740 %t5 = alloca x86_fp80
741 ; CHECK: %t5 = alloca x86_fp80
742 %t6 = alloca ppc_fp128
743 ; CHECK: %t6 = alloca ppc_fp128
745 ; CHECK: %t7 = alloca x86_mmx
746 %t8 = alloca %opaquety*
747 ; CHECK: %t8 = alloca ptr
752 declare void @llvm.token(token)
753 ; CHECK: declare void @llvm.token(token)
755 ;; Inline Assembler Expressions
756 define void @inlineasm(i32 %arg) {
757 call i32 asm "bswap $0", "=r,r"(i32 %arg)
758 ; CHECK: call i32 asm "bswap $0", "=r,r"(i32 %arg)
759 call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
760 ; CHECK: call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
766 ; Instructions -- Terminators
767 define void @instructions.terminators(i8 %val) personality i32 -10 {
768 br i1 false, label %iftrue, label %iffalse
769 ; CHECK: br i1 false, label %iftrue, label %iffalse
771 ; CHECK: br label %iftrue
777 switch i8 %val, label %defaultdest [
778 ; CHECK: switch i8 %val, label %defaultdest [
779 i8 0, label %defaultdest.0
780 ; CHECK: i8 0, label %defaultdest.0
781 i8 1, label %defaultdest.1
782 ; CHECK: i8 1, label %defaultdest.1
783 i8 2, label %defaultdest.2
784 ; CHECK: i8 2, label %defaultdest.2
795 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
796 ; CHECK: indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
797 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
798 ; CHECK: indirectbr ptr blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
800 invoke fastcc void @f.fastcc()
801 ; CHECK: invoke fastcc void @f.fastcc()
802 to label %defaultdest unwind label %exc
803 ; CHECK: to label %defaultdest unwind label %exc
805 %cleanup = landingpad i32 cleanup
808 ; CHECK: resume i32 undef
815 define i32 @instructions.win_eh.1() personality i32 -3 {
819 invoke void @f.ccc() to label %normal unwind label %catchswitch1
820 invoke void @f.ccc() to label %normal unwind label %catchswitch2
821 invoke void @f.ccc() to label %normal unwind label %catchswitch3
824 %cs1 = catchswitch within none [label %catchpad1] unwind to caller
827 catchpad within %cs1 []
829 ; CHECK: catchpad within %cs1 []
830 ; CHECK-NEXT: br label %normal
833 %cs2 = catchswitch within none [label %catchpad2] unwind to caller
836 catchpad within %cs2 [i32* %arg1]
838 ; CHECK: catchpad within %cs2 [ptr %arg1]
839 ; CHECK-NEXT: br label %normal
842 %cs3 = catchswitch within none [label %catchpad3] unwind label %cleanuppad1
845 catchpad within %cs3 [i32* %arg1, i32* %arg2]
847 ; CHECK: catchpad within %cs3 [ptr %arg1, ptr %arg2]
848 ; CHECK-NEXT: br label %normal
851 %clean.1 = cleanuppad within none []
853 ; CHECK: %clean.1 = cleanuppad within none []
854 ; CHECK-NEXT: unreachable
860 define i32 @instructions.win_eh.2() personality i32 -4 {
862 invoke void @f.ccc() to label %invoke.cont unwind label %catchswitch
865 invoke void @f.ccc() to label %continue unwind label %cleanup
868 %clean = cleanuppad within none []
869 ; CHECK: %clean = cleanuppad within none []
870 cleanupret from %clean unwind to caller
871 ; CHECK: cleanupret from %clean unwind to caller
874 %cs = catchswitch within none [label %catchpad] unwind label %terminate
877 %catch = catchpad within %cs []
879 ; CHECK: %catch = catchpad within %cs []
880 ; CHECK-NEXT: br label %body
883 invoke void @f.ccc() [ "funclet"(token %catch) ]
884 to label %continue unwind label %terminate.inner
885 catchret from %catch to label %return
886 ; CHECK: catchret from %catch to label %return
892 cleanuppad within %catch []
894 ; CHECK: cleanuppad within %catch []
895 ; CHECK-NEXT: unreachable
898 cleanuppad within none []
900 ; CHECK: cleanuppad within none []
901 ; CHECK-NEXT: unreachable
907 ; Instructions -- Binary Operations
908 define void @instructions.binops(i8 %op1, i8 %op2) {
911 ; CHECK: add i8 %op1, %op2
912 add nuw i8 %op1, %op2
913 ; CHECK: add nuw i8 %op1, %op2
914 add nsw i8 %op1, %op2
915 ; CHECK: add nsw i8 %op1, %op2
916 add nuw nsw i8 %op1, %op2
917 ; CHECK: add nuw nsw i8 %op1, %op2
919 ; CHECK: sub i8 %op1, %op2
920 sub nuw i8 %op1, %op2
921 ; CHECK: sub nuw i8 %op1, %op2
922 sub nsw i8 %op1, %op2
923 ; CHECK: sub nsw i8 %op1, %op2
924 sub nuw nsw i8 %op1, %op2
925 ; CHECK: sub nuw nsw i8 %op1, %op2
927 ; CHECK: mul i8 %op1, %op2
928 mul nuw i8 %op1, %op2
929 ; CHECK: mul nuw i8 %op1, %op2
930 mul nsw i8 %op1, %op2
931 ; CHECK: mul nsw i8 %op1, %op2
932 mul nuw nsw i8 %op1, %op2
933 ; CHECK: mul nuw nsw i8 %op1, %op2
937 ; CHECK: udiv i8 %op1, %op2
938 udiv exact i8 %op1, %op2
939 ; CHECK: udiv exact i8 %op1, %op2
941 ; CHECK: sdiv i8 %op1, %op2
942 sdiv exact i8 %op1, %op2
943 ; CHECK: sdiv exact i8 %op1, %op2
947 ; CHECK: urem i8 %op1, %op2
949 ; CHECK: srem i8 %op1, %op2
954 ; Instructions -- Bitwise Binary Operations
955 define void @instructions.bitwise_binops(i8 %op1, i8 %op2) {
958 ; CHECK: shl i8 %op1, %op2
959 shl nuw i8 %op1, %op2
960 ; CHECK: shl nuw i8 %op1, %op2
961 shl nsw i8 %op1, %op2
962 ; CHECK: shl nsw i8 %op1, %op2
963 shl nuw nsw i8 %op1, %op2
964 ; CHECK: shl nuw nsw i8 %op1, %op2
968 ; CHECK: lshr i8 %op1, %op2
969 lshr exact i8 %op1, %op2
970 ; CHECK: lshr exact i8 %op1, %op2
972 ; CHECK: ashr i8 %op1, %op2
973 ashr exact i8 %op1, %op2
974 ; CHECK: ashr exact i8 %op1, %op2
978 ; CHECK: and i8 %op1, %op2
980 ; CHECK: or i8 %op1, %op2
982 ; CHECK: xor i8 %op1, %op2
987 ; Instructions -- Vector Operations
988 define void @instructions.vectorops(<4 x float> %vec, <4 x float> %vec2) {
989 extractelement <4 x float> %vec, i8 0
990 ; CHECK: extractelement <4 x float> %vec, i8 0
991 insertelement <4 x float> %vec, float 3.500000e+00, i8 0
992 ; CHECK: insertelement <4 x float> %vec, float 3.500000e+00, i8 0
993 shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
994 ; CHECK: shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
999 ; Instructions -- Aggregate Operations
1000 define void @instructions.aggregateops({ i8, i32 } %up, <{ i8, i32 }> %p,
1001 [3 x i8] %arr, { i8, { i32 }} %n,
1002 <2 x i8*> %pvec, <2 x i64> %offsets) {
1003 extractvalue { i8, i32 } %up, 0
1004 ; CHECK: extractvalue { i8, i32 } %up, 0
1005 extractvalue <{ i8, i32 }> %p, 1
1006 ; CHECK: extractvalue <{ i8, i32 }> %p, 1
1007 extractvalue [3 x i8] %arr, 2
1008 ; CHECK: extractvalue [3 x i8] %arr, 2
1009 extractvalue { i8, { i32 } } %n, 1, 0
1010 ; CHECK: extractvalue { i8, { i32 } } %n, 1, 0
1012 insertvalue { i8, i32 } %up, i8 1, 0
1013 ; CHECK: insertvalue { i8, i32 } %up, i8 1, 0
1014 insertvalue <{ i8, i32 }> %p, i32 2, 1
1015 ; CHECK: insertvalue <{ i8, i32 }> %p, i32 2, 1
1016 insertvalue [3 x i8] %arr, i8 0, 0
1017 ; CHECK: insertvalue [3 x i8] %arr, i8 0, 0
1018 insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1019 ; CHECK: insertvalue { i8, { i32 } } %n, i32 0, 1, 0
1021 %up.ptr = alloca { i8, i32 }
1022 %p.ptr = alloca <{ i8, i32 }>
1023 %arr.ptr = alloca [3 x i8]
1024 %n.ptr = alloca { i8, { i32 } }
1026 getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
1027 ; CHECK: getelementptr { i8, i32 }, ptr %up.ptr, i8 0
1028 getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
1029 ; CHECK: getelementptr <{ i8, i32 }>, ptr %p.ptr, i8 1
1030 getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
1031 ; CHECK: getelementptr [3 x i8], ptr %arr.ptr, i8 2
1032 getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
1033 ; CHECK: getelementptr { i8, { i32 } }, ptr %n.ptr, i32 0, i32 1
1034 getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
1035 ; CHECK: getelementptr inbounds { i8, { i32 } }, ptr %n.ptr, i32 1, i32 0
1036 getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
1037 ; CHECK: getelementptr i8, <2 x ptr> %pvec, <2 x i64> %offsets
1042 ; Instructions -- Memory Access and Addressing Operations
1046 define void @instructions.memops(i32** %base) {
1047 alloca i32, i8 4, align 4
1048 ; CHECK: alloca i32, i8 4, align 4
1049 alloca inalloca i32, i8 4, align 4
1050 ; CHECK: alloca inalloca i32, i8 4, align 4
1052 load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1053 ; CHECK: load ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1054 load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1055 ; CHECK: load volatile ptr, ptr %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1057 store i32* null, i32** %base, align 4, !nontemporal !8
1058 ; CHECK: store ptr null, ptr %base, align 4, !nontemporal !8
1059 store volatile i32* null, i32** %base, align 4, !nontemporal !8
1060 ; CHECK: store volatile ptr null, ptr %base, align 4, !nontemporal !8
1065 ; Instructions -- Conversion Operations
1066 define void @instructions.conversions() {
1068 ; CHECK: trunc i32 -1 to i1
1070 ; CHECK: zext i32 -1 to i64
1072 ; CHECK: sext i32 -1 to i64
1073 fptrunc float undef to half
1074 ; CHECK: fptrunc float undef to half
1075 fpext half undef to float
1076 ; CHECK: fpext half undef to float
1077 fptoui float undef to i32
1078 ; CHECK: fptoui float undef to i32
1079 fptosi float undef to i32
1080 ; CHECK: fptosi float undef to i32
1081 uitofp i32 1 to float
1082 ; CHECK: uitofp i32 1 to float
1083 sitofp i32 -1 to float
1084 ; CHECK: sitofp i32 -1 to float
1085 ptrtoint i8* null to i64
1086 ; CHECK: ptrtoint ptr null to i64
1087 inttoptr i64 0 to i8*
1088 ; CHECK: inttoptr i64 0 to ptr
1089 bitcast i32 0 to i32
1090 ; CHECK: bitcast i32 0 to i32
1091 addrspacecast i32* null to i32 addrspace(1)*
1092 ; CHECK: addrspacecast ptr null to ptr addrspace(1)
1097 ; Instructions -- Other Operations
1098 define void @instructions.other(i32 %op1, i32 %op2, half %fop1, half %fop2) {
1100 icmp eq i32 %op1, %op2
1101 ; CHECK: icmp eq i32 %op1, %op2
1102 icmp ne i32 %op1, %op2
1103 ; CHECK: icmp ne i32 %op1, %op2
1104 icmp ugt i32 %op1, %op2
1105 ; CHECK: icmp ugt i32 %op1, %op2
1106 icmp uge i32 %op1, %op2
1107 ; CHECK: icmp uge i32 %op1, %op2
1108 icmp ult i32 %op1, %op2
1109 ; CHECK: icmp ult i32 %op1, %op2
1110 icmp ule i32 %op1, %op2
1111 ; CHECK: icmp ule i32 %op1, %op2
1112 icmp sgt i32 %op1, %op2
1113 ; CHECK: icmp sgt i32 %op1, %op2
1114 icmp sge i32 %op1, %op2
1115 ; CHECK: icmp sge i32 %op1, %op2
1116 icmp slt i32 %op1, %op2
1117 ; CHECK: icmp slt i32 %op1, %op2
1118 icmp sle i32 %op1, %op2
1119 ; CHECK: icmp sle i32 %op1, %op2
1121 fcmp false half %fop1, %fop2
1122 ; CHECK: fcmp false half %fop1, %fop2
1123 fcmp oeq half %fop1, %fop2
1124 ; CHECK: fcmp oeq half %fop1, %fop2
1125 fcmp ogt half %fop1, %fop2
1126 ; CHECK: fcmp ogt half %fop1, %fop2
1127 fcmp oge half %fop1, %fop2
1128 ; CHECK: fcmp oge half %fop1, %fop2
1129 fcmp olt half %fop1, %fop2
1130 ; CHECK: fcmp olt half %fop1, %fop2
1131 fcmp ole half %fop1, %fop2
1132 ; CHECK: fcmp ole half %fop1, %fop2
1133 fcmp one half %fop1, %fop2
1134 ; CHECK: fcmp one half %fop1, %fop2
1135 fcmp ord half %fop1, %fop2
1136 ; CHECK: fcmp ord half %fop1, %fop2
1137 fcmp ueq half %fop1, %fop2
1138 ; CHECK: fcmp ueq half %fop1, %fop2
1139 fcmp ugt half %fop1, %fop2
1140 ; CHECK: fcmp ugt half %fop1, %fop2
1141 fcmp uge half %fop1, %fop2
1142 ; CHECK: fcmp uge half %fop1, %fop2
1143 fcmp ult half %fop1, %fop2
1144 ; CHECK: fcmp ult half %fop1, %fop2
1145 fcmp ule half %fop1, %fop2
1146 ; CHECK: fcmp ule half %fop1, %fop2
1147 fcmp une half %fop1, %fop2
1148 ; CHECK: fcmp une half %fop1, %fop2
1149 fcmp uno half %fop1, %fop2
1150 ; CHECK: fcmp uno half %fop1, %fop2
1151 fcmp true half %fop1, %fop2
1152 ; CHECK: fcmp true half %fop1, %fop2
1156 %v1 = add i32 %op1, %op2
1159 %v2 = add i32 %op1, %op2
1162 phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1163 ; CHECK: phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1165 select i1 true, i32 0, i32 1
1166 ; CHECK: select i1 true, i32 0, i32 1
1167 select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1168 ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1170 call void @f.nobuiltin() builtin
1171 ; CHECK: call void @f.nobuiltin() #42
1173 call fastcc noalias i32* @f.noalias() noinline
1174 ; CHECK: call fastcc noalias ptr @f.noalias() #12
1175 tail call ghccc nonnull i32* @f.nonnull() minsize
1176 ; CHECK: tail call ghccc nonnull ptr @f.nonnull() #7
1181 define void @instructions.call_musttail(i8* inalloca %val) {
1182 musttail call void @f.param.inalloca(i8* inalloca %val)
1183 ; CHECK: musttail call void @f.param.inalloca(ptr inalloca(i8) %val)
1188 define void @instructions.call_notail() {
1189 notail call void @f1()
1190 ; CHECK: notail call void @f1()
1195 define void @instructions.landingpad() personality i32 -2 {
1196 invoke void @llvm.donothing() to label %proceed unwind label %catch1
1197 invoke void @llvm.donothing() to label %proceed unwind label %catch2
1198 invoke void @llvm.donothing() to label %proceed unwind label %catch3
1199 invoke void @llvm.donothing() to label %proceed unwind label %catch4
1203 ; CHECK: landingpad i32
1210 ; CHECK: landingpad i32
1214 ; CHECK: catch ptr null
1219 ; CHECK: landingpad i32
1223 ; CHECK: catch ptr null
1225 ; CHECK: catch ptr null
1230 ; CHECK: landingpad i32
1231 filter [2 x i32] zeroinitializer
1232 ; CHECK: filter [2 x i32] zeroinitializer
1239 ;; Intrinsic Functions
1241 ; Intrinsic Functions -- Variable Argument Handling
1242 declare void @llvm.va_start(i8*)
1243 declare void @llvm.va_copy(i8*, i8*)
1244 declare void @llvm.va_end(i8*)
1245 define void @instructions.va_arg(i8* %v, ...) {
1247 %ap2 = bitcast i8** %ap to i8*
1249 call void @llvm.va_start(i8* %ap2)
1250 ; CHECK: call void @llvm.va_start.p0(ptr %ap2)
1252 va_arg i8* %ap2, i32
1253 ; CHECK: va_arg ptr %ap2, i32
1255 call void @llvm.va_copy(i8* %v, i8* %ap2)
1256 ; CHECK: call void @llvm.va_copy.p0(ptr %v, ptr %ap2)
1258 call void @llvm.va_end(i8* %ap2)
1259 ; CHECK: call void @llvm.va_end.p0(ptr %ap2)
1264 ; Intrinsic Functions -- Accurate Garbage Collection
1265 declare void @llvm.gcroot(i8**, i8*)
1266 declare i8* @llvm.gcread(i8*, i8**)
1267 declare void @llvm.gcwrite(i8*, i8*, i8**)
1268 define void @intrinsics.gc() gc "shadow-stack" {
1269 %ptrloc = alloca i8*
1270 call void @llvm.gcroot(i8** %ptrloc, i8* null)
1271 ; CHECK: call void @llvm.gcroot(ptr %ptrloc, ptr null)
1273 call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1274 ; CHECK: call ptr @llvm.gcread(ptr null, ptr %ptrloc)
1277 call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1278 ; CHECK: call void @llvm.gcwrite(ptr %ref, ptr null, ptr %ptrloc)
1283 ; Intrinsic Functions -- Code Generation
1284 declare i8* @llvm.returnaddress(i32)
1285 declare i8* @llvm.frameaddress(i32)
1286 declare i32 @llvm.read_register.i32(metadata)
1287 declare i64 @llvm.read_register.i64(metadata)
1288 declare void @llvm.write_register.i32(metadata, i32)
1289 declare void @llvm.write_register.i64(metadata, i64)
1290 declare i8* @llvm.stacksave()
1291 declare void @llvm.stackrestore(i8*)
1292 declare void @llvm.prefetch(i8*, i32, i32, i32)
1293 declare void @llvm.pcmarker(i32)
1294 declare i64 @llvm.readcyclecounter()
1295 declare void @llvm.clear_cache(i8*, i8*)
1296 declare void @llvm.instrprof_increment(i8*, i64, i32, i32)
1299 define void @intrinsics.codegen() {
1300 call i8* @llvm.returnaddress(i32 1)
1301 ; CHECK: call ptr @llvm.returnaddress(i32 1)
1302 call i8* @llvm.frameaddress(i32 1)
1303 ; CHECK: call ptr @llvm.frameaddress.p0(i32 1)
1305 call i32 @llvm.read_register.i32(metadata !10)
1306 ; CHECK: call i32 @llvm.read_register.i32(metadata !10)
1307 call i64 @llvm.read_register.i64(metadata !10)
1308 ; CHECK: call i64 @llvm.read_register.i64(metadata !10)
1309 call void @llvm.write_register.i32(metadata !10, i32 0)
1310 ; CHECK: call void @llvm.write_register.i32(metadata !10, i32 0)
1311 call void @llvm.write_register.i64(metadata !10, i64 0)
1312 ; CHECK: call void @llvm.write_register.i64(metadata !10, i64 0)
1314 %stack = call i8* @llvm.stacksave()
1315 ; CHECK: %stack = call ptr @llvm.stacksave.p0()
1316 call void @llvm.stackrestore(i8* %stack)
1317 ; CHECK: call void @llvm.stackrestore.p0(ptr %stack)
1319 call void @llvm.prefetch(i8* %stack, i32 0, i32 3, i32 0)
1320 ; CHECK: call void @llvm.prefetch.p0(ptr %stack, i32 0, i32 3, i32 0)
1322 call void @llvm.pcmarker(i32 1)
1323 ; CHECK: call void @llvm.pcmarker(i32 1)
1325 call i64 @llvm.readcyclecounter()
1326 ; CHECK: call i64 @llvm.readcyclecounter()
1328 call void @llvm.clear_cache(i8* null, i8* null)
1329 ; CHECK: call void @llvm.clear_cache(ptr null, ptr null)
1331 call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1332 ; CHECK: call void @llvm.instrprof_increment(ptr null, i64 0, i32 0, i32 0)
1337 declare void @llvm.localescape(...)
1338 declare i8* @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
1339 define void @intrinsics.localescape() {
1340 %static.alloca = alloca i32
1341 call void (...) @llvm.localescape(i32* %static.alloca)
1342 ; CHECK: call void (...) @llvm.localescape(ptr %static.alloca)
1344 call void @intrinsics.localrecover()
1348 define void @intrinsics.localrecover() {
1349 %func = bitcast void ()* @intrinsics.localescape to i8*
1350 %fp = call i8* @llvm.frameaddress(i32 1)
1351 call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1352 ; CHECK: call ptr @llvm.localrecover(ptr %func, ptr %fp, i32 0)
1357 ; We need this function to provide `uses' for some metadata tests.
1358 define void @misc.metadata() {
1359 call void @f1(), !srcloc !11
1360 call void @f1(), !srcloc !12
1361 call void @f1(), !srcloc !13
1362 call void @f1(), !srcloc !14
1366 declare void @op_bundle_callee_0()
1367 declare void @op_bundle_callee_1(i32,i32)
1369 define void @call_with_operand_bundle0(i32* %ptr) {
1370 ; CHECK-LABEL: call_with_operand_bundle0(
1372 %l = load i32, i32* %ptr
1374 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1375 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1379 define void @call_with_operand_bundle1(i32* %ptr) {
1380 ; CHECK-LABEL: call_with_operand_bundle1(
1382 %l = load i32, i32* %ptr
1385 call void @op_bundle_callee_0()
1386 call void @op_bundle_callee_0() [ "foo"() ]
1387 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1388 ; CHECK: @op_bundle_callee_0(){{$}}
1389 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"() ]
1390 ; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1394 define void @call_with_operand_bundle2(i32* %ptr) {
1395 ; CHECK-LABEL: call_with_operand_bundle2(
1397 call void @op_bundle_callee_0() [ "foo"() ]
1398 ; CHECK: call void @op_bundle_callee_0() [ "foo"() ]
1402 define void @call_with_operand_bundle3(i32* %ptr) {
1403 ; CHECK-LABEL: call_with_operand_bundle3(
1405 %l = load i32, i32* %ptr
1407 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1408 ; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1412 define void @call_with_operand_bundle4(i32* %ptr) {
1413 ; CHECK-LABEL: call_with_operand_bundle4(
1415 %l = load i32, i32* %ptr
1417 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) ]
1418 ; 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) ]
1422 ; Invoke versions of the above tests:
1425 define void @invoke_with_operand_bundle0(i32* %ptr) personality i8 3 {
1426 ; CHECK-LABEL: @invoke_with_operand_bundle0(
1428 %l = load i32, i32* %ptr
1430 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
1431 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
1434 %cleanup = landingpad i8 cleanup
1440 define void @invoke_with_operand_bundle1(i32* %ptr) personality i8 3 {
1441 ; CHECK-LABEL: @invoke_with_operand_bundle1(
1443 %l = load i32, i32* %ptr
1446 invoke void @op_bundle_callee_0() to label %normal unwind label %exception
1447 ; CHECK: invoke void @op_bundle_callee_0(){{$}}
1450 %cleanup = landingpad i8 cleanup
1454 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal1 unwind label %exception1
1455 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1458 %cleanup1 = landingpad i8 cleanup
1462 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
1463 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1466 %cleanup2 = landingpad i8 cleanup
1473 define void @invoke_with_operand_bundle2(i32* %ptr) personality i8 3 {
1474 ; CHECK-LABEL: @invoke_with_operand_bundle2(
1476 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal unwind label %exception
1477 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1480 %cleanup = landingpad i8 cleanup
1486 define void @invoke_with_operand_bundle3(i32* %ptr) personality i8 3 {
1487 ; CHECK-LABEL: @invoke_with_operand_bundle3(
1489 %l = load i32, i32* %ptr
1491 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
1492 ; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
1495 %cleanup = landingpad i8 cleanup
1501 define void @invoke_with_operand_bundle4(i32* %ptr) personality i8 3 {
1502 ; CHECK-LABEL: @invoke_with_operand_bundle4(
1504 %l = load i32, i32* %ptr
1506 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) ]
1507 to label %normal unwind label %exception
1508 ; 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) ]
1511 %cleanup = landingpad i8 cleanup
1518 ; CHECK: attributes #0 = { alignstack=4 }
1519 ; CHECK: attributes #1 = { alignstack=8 }
1520 ; CHECK: attributes #2 = { alwaysinline }
1521 ; CHECK: attributes #3 = { cold }
1522 ; CHECK: attributes #4 = { convergent }
1523 ; CHECK: attributes #5 = { inlinehint }
1524 ; CHECK: attributes #6 = { jumptable }
1525 ; CHECK: attributes #7 = { minsize }
1526 ; CHECK: attributes #8 = { naked }
1527 ; CHECK: attributes #9 = { nobuiltin }
1528 ; CHECK: attributes #10 = { noduplicate }
1529 ; CHECK: attributes #11 = { noimplicitfloat }
1530 ; CHECK: attributes #12 = { noinline }
1531 ; CHECK: attributes #13 = { nonlazybind }
1532 ; CHECK: attributes #14 = { noredzone }
1533 ; CHECK: attributes #15 = { noreturn }
1534 ; CHECK: attributes #16 = { nounwind }
1535 ; CHECK: attributes #17 = { noinline optnone }
1536 ; CHECK: attributes #18 = { optsize }
1537 ; CHECK: attributes #19 = { memory(none) }
1538 ; CHECK: attributes #20 = { memory(read) }
1539 ; CHECK: attributes #21 = { returns_twice }
1540 ; CHECK: attributes #22 = { safestack }
1541 ; CHECK: attributes #23 = { sanitize_address }
1542 ; CHECK: attributes #24 = { sanitize_memory }
1543 ; CHECK: attributes #25 = { sanitize_thread }
1544 ; CHECK: attributes #26 = { ssp }
1545 ; CHECK: attributes #27 = { sspreq }
1546 ; CHECK: attributes #28 = { sspstrong }
1547 ; CHECK: attributes #29 = { "thunk" }
1548 ; CHECK: attributes #30 = { uwtable }
1549 ; CHECK: attributes #31 = { "cpu"="cortex-a8" }
1550 ; CHECK: attributes #32 = { norecurse }
1551 ; CHECK: attributes #33 = { memory(inaccessiblemem: readwrite) }
1552 ; CHECK: attributes #34 = { memory(argmem: readwrite, inaccessiblemem: readwrite) }
1553 ; CHECK: attributes #35 = { nocallback nofree nosync nounwind willreturn memory(none) }
1554 ; CHECK: attributes #36 = { nounwind memory(argmem: read) }
1555 ; CHECK: attributes #37 = { nounwind memory(argmem: readwrite) }
1556 ; CHECK: attributes #38 = { nocallback nofree nosync nounwind willreturn memory(read) }
1557 ; CHECK: attributes #39 = { nocallback nounwind }
1558 ; CHECK: attributes #40 = { nocallback nofree nosync nounwind willreturn }
1559 ; CHECK: attributes #41 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
1560 ; CHECK: attributes #42 = { builtin }
1564 ; Metadata -- Module flags
1565 !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1566 ; CHECK: !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1568 !0 = !{i32 1, !"mod1", i32 0}
1569 ; CHECK: !0 = !{i32 1, !"mod1", i32 0}
1570 !1 = !{i32 2, !"mod2", i32 0}
1571 ; CHECK: !1 = !{i32 2, !"mod2", i32 0}
1572 !2 = !{i32 3, !"mod3", !3}
1573 ; CHECK: !2 = !{i32 3, !"mod3", !3}
1575 ; CHECK: !3 = !{!"mod6", !0}
1576 !4 = !{i32 4, !"mod4", i32 0}
1577 ; CHECK: !4 = !{i32 4, !"mod4", i32 0}
1578 !5 = !{i32 5, !"mod5", !0}
1579 ; CHECK: !5 = !{i32 5, !"mod5", !0}
1580 !6 = !{i32 6, !"mod6", !0}
1581 ; CHECK: !6 = !{i32 6, !"mod6", !0}
1583 ; Metadata -- Check `distinct'
1585 ; CHECK: !11 = distinct !{}
1587 ; CHECK: !12 = distinct !{}
1589 ; CHECK: !13 = !{!11}
1591 ; CHECK: !14 = !{!12}