1; Bitcode compatibility test for llvm
2;
3; Please update this file when making any IR changes. Information on the
4; release process for this file is available here:
5;
6;     http://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility
7
8; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
9; RUN-PR24755: verify-uselistorder < %s
10
11target datalayout = "E"
12; CHECK: target datalayout = "E"
13
14target triple = "x86_64-apple-macosx10.10.0"
15; CHECK: target triple = "x86_64-apple-macosx10.10.0"
16
17;; Module-level assembly
18module asm "beep boop"
19; CHECK: module asm "beep boop"
20
21;; Comdats
22$comdat.any = comdat any
23; CHECK: $comdat.any = comdat any
24$comdat.exactmatch = comdat exactmatch
25; CHECK: $comdat.exactmatch = comdat exactmatch
26$comdat.largest = comdat largest
27; CHECK: $comdat.largest = comdat largest
28$comdat.noduplicates = comdat noduplicates
29; CHECK: $comdat.noduplicates = comdat noduplicates
30$comdat.samesize = comdat samesize
31; CHECK: $comdat.samesize = comdat samesize
32
33;; Constants
34@const.true = constant i1 true
35; CHECK: @const.true = constant i1 true
36@const.false = constant i1 false
37; CHECK: @const.false = constant i1 false
38@const.int = constant i32 zeroinitializer
39; CHECK: @const.int = constant i32 0
40@const.float = constant double 0.0
41; CHECK: @const.float = constant double 0.0
42@const.null = constant i8* null
43; CHECK: @const.null = constant i8* null
44%const.struct.type = type { i32, i8 }
45%const.struct.type.packed = type <{ i32, i8 }>
46@const.struct = constant %const.struct.type { i32 -1, i8 undef }
47; CHECK: @const.struct = constant %const.struct.type { i32 -1, i8 undef }
48@const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }>
49; CHECK: @const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }>
50@const.array = constant [2 x i32] [i32 -3, i32 -4]
51; CHECK: @const.array = constant [2 x i32] [i32 -3, i32 -4]
52@const.vector = constant <2 x i32> <i32 -5, i32 -6>
53; CHECK: @const.vector = constant <2 x i32> <i32 -5, i32 -6>
54
55;; Global Variables
56; Format: [@<GlobalVarName> =] [Linkage] [Visibility] [DLLStorageClass]
57;         [ThreadLocal] [unnamed_addr] [AddrSpace] [ExternallyInitialized]
58;         <global | constant> <Type> [<InitializerConstant>]
59;         [, section "name"] [, comdat [($name)]] [, align <Alignment>]
60
61; Global Variables -- Simple
62@g1 = global i32 0
63; CHECK: @g1 = global i32 0
64@g2 = constant i32 0
65; CHECK: @g2 = constant i32 0
66
67; Global Variables -- Linkage
68@g.private = private global i32 0
69; CHECK: @g.private = private global i32 0
70@g.internal = internal global i32 0
71; CHECK: @g.internal = internal global i32 0
72@g.available_externally = available_externally global i32 0
73; CHECK: @g.available_externally = available_externally global i32 0
74@g.linkonce = linkonce global i32 0
75; CHECK: @g.linkonce = linkonce global i32 0
76@g.weak = weak global i32 0
77; CHECK: @g.weak = weak global i32 0
78@g.common = common global i32 0
79; CHECK: @g.common = common global i32 0
80@g.appending = appending global [4 x i8] c"test"
81; CHECK: @g.appending = appending global [4 x i8] c"test"
82@g.extern_weak = extern_weak global i32
83; CHECK: @g.extern_weak = extern_weak global i32
84@g.linkonce_odr = linkonce_odr global i32 0
85; CHECK: @g.linkonce_odr = linkonce_odr global i32 0
86@g.weak_odr = weak_odr global i32 0
87; CHECK: @g.weak_odr = weak_odr global i32 0
88@g.external = external global i32
89; CHECK: @g.external = external global i32
90
91; Global Variables -- Visibility
92@g.default = default global i32 0
93; CHECK: @g.default = global i32 0
94@g.hidden = hidden global i32 0
95; CHECK: @g.hidden = hidden global i32 0
96@g.protected = protected global i32 0
97; CHECK: @g.protected = protected global i32 0
98
99; Global Variables -- DLLStorageClass
100@g.dlldefault = default global i32 0
101; CHECK: @g.dlldefault = global i32 0
102@g.dllimport = external dllimport global i32
103; CHECK: @g.dllimport = external dllimport global i32
104@g.dllexport = dllexport global i32 0
105; CHECK: @g.dllexport = dllexport global i32 0
106
107; Global Variables -- ThreadLocal
108@g.notthreadlocal = global i32 0
109; CHECK: @g.notthreadlocal = global i32 0
110@g.generaldynamic = thread_local global i32 0
111; CHECK: @g.generaldynamic = thread_local global i32 0
112@g.localdynamic = thread_local(localdynamic) global i32 0
113; CHECK: @g.localdynamic = thread_local(localdynamic) global i32 0
114@g.initialexec = thread_local(initialexec) global i32 0
115; CHECK: @g.initialexec = thread_local(initialexec) global i32 0
116@g.localexec = thread_local(localexec) global i32 0
117; CHECK: @g.localexec = thread_local(localexec) global i32 0
118
119; Global Variables -- unnamed_addr
120@g.unnamed_addr = unnamed_addr global i32 0
121; CHECK: @g.unnamed_addr = unnamed_addr global i32 0
122
123; Global Variables -- AddrSpace
124@g.addrspace = addrspace(1) global i32 0
125; CHECK: @g.addrspace = addrspace(1) global i32 0
126
127; Global Variables -- ExternallyInitialized
128@g.externally_initialized = external externally_initialized global i32
129; CHECK: @g.externally_initialized = external externally_initialized global i32
130
131; Global Variables -- section
132@g.section = global i32 0, section "_DATA"
133; CHECK: @g.section = global i32 0, section "_DATA"
134
135; Global Variables -- comdat
136@comdat.any = global i32 0, comdat
137; CHECK: @comdat.any = global i32 0, comdat
138@comdat.exactmatch = global i32 0, comdat
139; CHECK: @comdat.exactmatch = global i32 0, comdat
140@comdat.largest = global i32 0, comdat
141; CHECK: @comdat.largest = global i32 0, comdat
142@comdat.noduplicates = global i32 0, comdat
143; CHECK: @comdat.noduplicates = global i32 0, comdat
144@comdat.samesize = global i32 0, comdat
145; CHECK: @comdat.samesize = global i32 0, comdat
146
147; Force two globals from different comdats into sections with the same name.
148$comdat1 = comdat any
149$comdat2 = comdat any
150@g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
151; CHECK: @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1)
152@g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
153; CHECK: @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2)
154
155; Global Variables -- align
156@g.align = global i32 0, align 4
157; CHECK: @g.align = global i32 0, align 4
158
159; Global Variables -- Intrinsics
160%pri.func.data = type { i32, void ()*, i8* }
161@g.used1 = global i32 0
162@g.used2 = global i32 0
163@g.used3 = global i8 0
164declare void @g.f1()
165@llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
166; CHECK: @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata"
167@llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
168; CHECK: @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata"
169@llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
170; 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"
171@llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata"
172; 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"
173
174;; Aliases
175; Format: @<Name> = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
176;                   [unnamed_addr] alias <AliaseeTy> @<Aliasee>
177
178; Aliases -- Linkage
179@a.private = private alias i32, i32* @g.private
180; CHECK: @a.private = private alias i32, i32* @g.private
181@a.internal = internal alias i32, i32* @g.internal
182; CHECK: @a.internal = internal alias i32, i32* @g.internal
183@a.linkonce = linkonce alias i32, i32* @g.linkonce
184; CHECK: @a.linkonce = linkonce alias i32, i32* @g.linkonce
185@a.weak = weak alias i32, i32* @g.weak
186; CHECK: @a.weak = weak alias i32, i32* @g.weak
187@a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
188; CHECK: @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
189@a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
190; CHECK: @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
191@a.external = external alias i32, i32* @g1
192; CHECK: @a.external = alias i32, i32* @g1
193
194; Aliases -- Visibility
195@a.default = default alias i32, i32* @g.default
196; CHECK: @a.default = alias i32, i32* @g.default
197@a.hidden = hidden alias i32, i32* @g.hidden
198; CHECK: @a.hidden = hidden alias i32, i32* @g.hidden
199@a.protected = protected alias i32, i32* @g.protected
200; CHECK: @a.protected = protected alias i32, i32* @g.protected
201
202; Aliases -- DLLStorageClass
203@a.dlldefault = default alias i32, i32* @g.dlldefault
204; CHECK: @a.dlldefault = alias i32, i32* @g.dlldefault
205@a.dllimport = dllimport alias i32, i32* @g1
206; CHECK: @a.dllimport = dllimport alias i32, i32* @g1
207@a.dllexport = dllexport alias i32, i32* @g.dllexport
208; CHECK: @a.dllexport = dllexport alias i32, i32* @g.dllexport
209
210; Aliases -- ThreadLocal
211@a.notthreadlocal = alias i32, i32* @g.notthreadlocal
212; CHECK: @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
213@a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
214; CHECK: @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
215@a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
216; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
217@a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
218; CHECK: @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
219@a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
220; CHECK: @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
221
222; Aliases -- unnamed_addr
223@a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
224; CHECK: @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
225
226;; Functions
227; Format: define [linkage] [visibility] [DLLStorageClass]
228;         [cconv] [ret attrs]
229;         <ResultType> @<FunctionName> ([argument list])
230;         [unnamed_addr] [fn Attrs] [section "name"] [comdat [($name)]]
231;         [align N] [gc] [prefix Constant] [prologue Constant]
232;         [personality Constant] { ... }
233
234; Functions -- Simple
235declare void @f1 ()
236; CHECK: declare void @f1()
237
238define void @f2 () {
239; CHECK: define void @f2()
240entry:
241  ret void
242}
243
244; Functions -- linkage
245define private void @f.private() {
246; CHECK: define private void @f.private()
247entry:
248  ret void
249}
250define internal void @f.internal() {
251; CHECK: define internal void @f.internal()
252entry:
253  ret void
254}
255define available_externally void @f.available_externally() {
256; CHECK: define available_externally void @f.available_externally()
257entry:
258  ret void
259}
260define linkonce void @f.linkonce() {
261; CHECK: define linkonce void @f.linkonce()
262entry:
263  ret void
264}
265define weak void @f.weak() {
266; CHECK: define weak void @f.weak()
267entry:
268  ret void
269}
270define linkonce_odr void @f.linkonce_odr() {
271; CHECK: define linkonce_odr void @f.linkonce_odr()
272entry:
273  ret void
274}
275define weak_odr void @f.weak_odr() {
276; CHECK: define weak_odr void @f.weak_odr()
277entry:
278  ret void
279}
280declare external void @f.external()
281; CHECK: declare void @f.external()
282declare extern_weak void @f.extern_weak()
283; CHECK: declare extern_weak void @f.extern_weak()
284
285; Functions -- visibility
286declare default void @f.default()
287; CHECK: declare void @f.default()
288declare hidden void @f.hidden()
289; CHECK: declare hidden void @f.hidden()
290declare protected void @f.protected()
291; CHECK: declare protected void @f.protected()
292
293; Functions -- DLLStorageClass
294declare dllimport void @f.dllimport()
295; CHECK: declare dllimport void @f.dllimport()
296declare dllexport void @f.dllexport()
297; CHECK: declare dllexport void @f.dllexport()
298
299; Functions -- cconv (Calling conventions)
300declare ccc void @f.ccc()
301; CHECK: declare void @f.ccc()
302declare fastcc void @f.fastcc()
303; CHECK: declare fastcc void @f.fastcc()
304declare coldcc void @f.coldcc()
305; CHECK: declare coldcc void @f.coldcc()
306declare cc10 void @f.cc10()
307; CHECK: declare ghccc void @f.cc10()
308declare ghccc void @f.ghccc()
309; CHECK: declare ghccc void @f.ghccc()
310declare cc11 void @f.cc11()
311; CHECK: declare cc11 void @f.cc11()
312declare webkit_jscc void @f.webkit_jscc()
313; CHECK: declare webkit_jscc void @f.webkit_jscc()
314declare anyregcc void @f.anyregcc()
315; CHECK: declare anyregcc void @f.anyregcc()
316declare preserve_mostcc void @f.preserve_mostcc()
317; CHECK: declare preserve_mostcc void @f.preserve_mostcc()
318declare preserve_allcc void @f.preserve_allcc()
319; CHECK: declare preserve_allcc void @f.preserve_allcc()
320declare cc64 void @f.cc64()
321; CHECK: declare x86_stdcallcc void @f.cc64()
322declare x86_stdcallcc void @f.x86_stdcallcc()
323; CHECK: declare x86_stdcallcc void @f.x86_stdcallcc()
324declare cc65 void @f.cc65()
325; CHECK: declare x86_fastcallcc void @f.cc65()
326declare x86_fastcallcc void @f.x86_fastcallcc()
327; CHECK: declare x86_fastcallcc void @f.x86_fastcallcc()
328declare cc66 void @f.cc66()
329; CHECK: declare arm_apcscc void @f.cc66()
330declare arm_apcscc void @f.arm_apcscc()
331; CHECK: declare arm_apcscc void @f.arm_apcscc()
332declare cc67 void @f.cc67()
333; CHECK: declare arm_aapcscc void @f.cc67()
334declare arm_aapcscc void @f.arm_aapcscc()
335; CHECK: declare arm_aapcscc void @f.arm_aapcscc()
336declare cc68 void @f.cc68()
337; CHECK: declare arm_aapcs_vfpcc void @f.cc68()
338declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
339; CHECK: declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc()
340declare cc69 void @f.cc69()
341; CHECK: declare msp430_intrcc void @f.cc69()
342declare msp430_intrcc void @f.msp430_intrcc()
343; CHECK: declare msp430_intrcc void @f.msp430_intrcc()
344declare cc70 void @f.cc70()
345; CHECK: declare x86_thiscallcc void @f.cc70()
346declare x86_thiscallcc void @f.x86_thiscallcc()
347; CHECK: declare x86_thiscallcc void @f.x86_thiscallcc()
348declare cc71 void @f.cc71()
349; CHECK: declare ptx_kernel void @f.cc71()
350declare ptx_kernel void @f.ptx_kernel()
351; CHECK: declare ptx_kernel void @f.ptx_kernel()
352declare cc72 void @f.cc72()
353; CHECK: declare ptx_device void @f.cc72()
354declare ptx_device void @f.ptx_device()
355; CHECK: declare ptx_device void @f.ptx_device()
356declare cc75 void @f.cc75()
357; CHECK: declare spir_func void @f.cc75()
358declare spir_func void @f.spir_func()
359; CHECK: declare spir_func void @f.spir_func()
360declare cc76 void @f.cc76()
361; CHECK: declare spir_kernel void @f.cc76()
362declare spir_kernel void @f.spir_kernel()
363; CHECK: declare spir_kernel void @f.spir_kernel()
364declare cc77 void @f.cc77()
365; CHECK: declare intel_ocl_bicc void @f.cc77()
366declare intel_ocl_bicc void @f.intel_ocl_bicc()
367; CHECK: declare intel_ocl_bicc void @f.intel_ocl_bicc()
368declare cc78 void @f.cc78()
369; CHECK: declare x86_64_sysvcc void @f.cc78()
370declare x86_64_sysvcc void @f.x86_64_sysvcc()
371; CHECK: declare x86_64_sysvcc void @f.x86_64_sysvcc()
372declare cc79 void @f.cc79()
373; CHECK: declare x86_64_win64cc void @f.cc79()
374declare x86_64_win64cc void @f.x86_64_win64cc()
375; CHECK: declare x86_64_win64cc void @f.x86_64_win64cc()
376declare cc80 void @f.cc80()
377; CHECK: declare x86_vectorcallcc void @f.cc80()
378declare x86_vectorcallcc void @f.x86_vectorcallcc()
379; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc()
380declare cc1023 void @f.cc1023()
381; CHECK: declare cc1023 void @f.cc1023()
382
383; Functions -- ret attrs (Return attributes)
384declare zeroext i64 @f.zeroext()
385; CHECK: declare zeroext i64 @f.zeroext()
386declare signext i64 @f.signext()
387; CHECK: declare signext i64 @f.signext()
388declare inreg i32* @f.inreg()
389; CHECK: declare inreg i32* @f.inreg()
390declare noalias i32* @f.noalias()
391; CHECK: declare noalias i32* @f.noalias()
392declare nonnull i32* @f.nonnull()
393; CHECK: declare nonnull i32* @f.nonnull()
394declare dereferenceable(4) i32* @f.dereferenceable4()
395; CHECK: declare dereferenceable(4) i32* @f.dereferenceable4()
396declare dereferenceable(8) i32* @f.dereferenceable8()
397; CHECK: declare dereferenceable(8) i32* @f.dereferenceable8()
398declare dereferenceable(16) i32* @f.dereferenceable16()
399; CHECK: declare dereferenceable(16) i32* @f.dereferenceable16()
400declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
401; CHECK: declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null()
402declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
403; CHECK: declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null()
404declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
405; CHECK: declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null()
406
407; Functions -- Parameter attributes
408declare void @f.param.zeroext(i8 zeroext)
409; CHECK: declare void @f.param.zeroext(i8 zeroext)
410declare void @f.param.signext(i8 signext)
411; CHECK: declare void @f.param.signext(i8 signext)
412declare void @f.param.inreg(i8 inreg)
413; CHECK: declare void @f.param.inreg(i8 inreg)
414declare void @f.param.byval({ i8, i8 }* byval)
415; CHECK: declare void @f.param.byval({ i8, i8 }* byval)
416declare void @f.param.inalloca(i8* inalloca)
417; CHECK: declare void @f.param.inalloca(i8* inalloca)
418declare void @f.param.sret(i8* sret)
419; CHECK: declare void @f.param.sret(i8* sret)
420declare void @f.param.noalias(i8* noalias)
421; CHECK: declare void @f.param.noalias(i8* noalias)
422declare void @f.param.nocapture(i8* nocapture)
423; CHECK: declare void @f.param.nocapture(i8* nocapture)
424declare void @f.param.nest(i8* nest)
425; CHECK: declare void @f.param.nest(i8* nest)
426declare i8* @f.param.returned(i8* returned)
427; CHECK: declare i8* @f.param.returned(i8* returned)
428declare void @f.param.nonnull(i8* nonnull)
429; CHECK: declare void @f.param.nonnull(i8* nonnull)
430declare void @f.param.dereferenceable(i8* dereferenceable(4))
431; CHECK: declare void @f.param.dereferenceable(i8* dereferenceable(4))
432declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
433; CHECK: declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4))
434
435; Functions -- unnamed_addr
436declare void @f.unnamed_addr() unnamed_addr
437; CHECK: declare void @f.unnamed_addr() unnamed_addr
438
439; Functions -- fn Attrs (Function attributes)
440declare void @f.alignstack4() alignstack(4)
441; CHECK: declare void @f.alignstack4() #0
442declare void @f.alignstack8() alignstack(8)
443; CHECK: declare void @f.alignstack8() #1
444declare void @f.alwaysinline() alwaysinline
445; CHECK: declare void @f.alwaysinline() #2
446declare void @f.cold() cold
447; CHECK: declare void @f.cold() #3
448declare void @f.convergent() convergent
449; CHECK: declare void @f.convergent() #4
450declare void @f.inlinehint() inlinehint
451; CHECK: declare void @f.inlinehint() #5
452declare void @f.jumptable() unnamed_addr jumptable
453; CHECK: declare void @f.jumptable() unnamed_addr #6
454declare void @f.minsize() minsize
455; CHECK: declare void @f.minsize() #7
456declare void @f.naked() naked
457; CHECK: declare void @f.naked() #8
458declare void @f.nobuiltin() nobuiltin
459; CHECK: declare void @f.nobuiltin() #9
460declare void @f.noduplicate() noduplicate
461; CHECK: declare void @f.noduplicate() #10
462declare void @f.noimplicitfloat() noimplicitfloat
463; CHECK: declare void @f.noimplicitfloat() #11
464declare void @f.noinline() noinline
465; CHECK: declare void @f.noinline() #12
466declare void @f.nonlazybind() nonlazybind
467; CHECK: declare void @f.nonlazybind() #13
468declare void @f.noredzone() noredzone
469; CHECK: declare void @f.noredzone() #14
470declare void @f.noreturn() noreturn
471; CHECK: declare void @f.noreturn() #15
472declare void @f.nounwind() nounwind
473; CHECK: declare void @f.nounwind() #16
474declare void @f.optnone() noinline optnone
475; CHECK: declare void @f.optnone() #17
476declare void @f.optsize() optsize
477; CHECK: declare void @f.optsize() #18
478declare void @f.readnone() readnone
479; CHECK: declare void @f.readnone() #19
480declare void @f.readonly() readonly
481; CHECK: declare void @f.readonly() #20
482declare void @f.returns_twice() returns_twice
483; CHECK: declare void @f.returns_twice() #21
484declare void @f.safestack() safestack
485; CHECK: declare void @f.safestack() #22
486declare void @f.sanitize_address() sanitize_address
487; CHECK: declare void @f.sanitize_address() #23
488declare void @f.sanitize_memory() sanitize_memory
489; CHECK: declare void @f.sanitize_memory() #24
490declare void @f.sanitize_thread() sanitize_thread
491; CHECK: declare void @f.sanitize_thread() #25
492declare void @f.ssp() ssp
493; CHECK: declare void @f.ssp() #26
494declare void @f.sspreq() sspreq
495; CHECK: declare void @f.sspreq() #27
496declare void @f.sspstrong() sspstrong
497; CHECK: declare void @f.sspstrong() #28
498declare void @f.thunk() "thunk"
499; CHECK: declare void @f.thunk() #29
500declare void @f.uwtable() uwtable
501; CHECK: declare void @f.uwtable() #30
502declare void @f.kvpair() "cpu"="cortex-a8"
503; CHECK:declare void @f.kvpair() #31
504declare void @f.norecurse() norecurse
505; CHECK: declare void @f.norecurse() #32
506declare void @f.inaccessiblememonly() inaccessiblememonly
507; CHECK: declare void @f.inaccessiblememonly() #33
508declare void @f.inaccessiblemem_or_argmemonly() inaccessiblemem_or_argmemonly
509; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #34
510
511; Functions -- section
512declare void @f.section() section "80"
513; CHECK: declare void @f.section() section "80"
514
515; Functions -- comdat
516define void @f.comdat_any() comdat($comdat.any) {
517; CHECK: define void @f.comdat_any() comdat($comdat.any)
518entry:
519  ret void
520}
521define void @f.comdat_exactmatch() comdat($comdat.exactmatch) {
522; CHECK: define void @f.comdat_exactmatch() comdat($comdat.exactmatch)
523entry:
524  ret void
525}
526define void @f.comdat_largest() comdat($comdat.largest) {
527; CHECK: define void @f.comdat_largest() comdat($comdat.largest)
528entry:
529  ret void
530}
531define void @f.comdat_noduplicates() comdat($comdat.noduplicates) {
532; CHECK: define void @f.comdat_noduplicates() comdat($comdat.noduplicates)
533entry:
534  ret void
535}
536define void @f.comdat_samesize() comdat($comdat.samesize) {
537; CHECK: define void @f.comdat_samesize() comdat($comdat.samesize)
538entry:
539  ret void
540}
541
542; Functions -- align
543declare void @f.align2() align 2
544; CHECK: declare void @f.align2() align 2
545declare void @f.align4() align 4
546; CHECK: declare void @f.align4() align 4
547declare void @f.align8() align 8
548; CHECK: declare void @f.align8() align 8
549
550; Functions -- GC
551declare void @f.gcshadow() gc "shadow-stack"
552; CHECK: declare void @f.gcshadow() gc "shadow-stack"
553
554; Functions -- Prefix data
555declare void @f.prefixi32() prefix i32 1684365668
556; CHECK: declare void @f.prefixi32() prefix i32 1684365668
557declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
558; CHECK: declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3]
559
560; Functions -- Prologue data
561declare void @f.prologuei32() prologue i32 1684365669
562; CHECK: declare void @f.prologuei32() prologue i32 1684365669
563declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
564; CHECK: declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
565
566; Functions -- Personality constant
567declare void @llvm.donothing() nounwind readnone
568; CHECK: declare void @llvm.donothing() #35
569define void @f.no_personality() personality i8 3 {
570; CHECK: define void @f.no_personality() personality i8 3
571  invoke void @llvm.donothing() to label %normal unwind label %exception
572exception:
573  %cleanup = landingpad i8 cleanup
574  br label %normal
575normal:
576  ret void
577}
578
579declare i32 @f.personality_handler()
580; CHECK: declare i32 @f.personality_handler()
581define void @f.personality() personality i32 ()* @f.personality_handler {
582; CHECK: define void @f.personality() personality i32 ()* @f.personality_handler
583  invoke void @llvm.donothing() to label %normal unwind label %exception
584exception:
585  %cleanup = landingpad i32 cleanup
586  br label %normal
587normal:
588  ret void
589}
590
591;; Atomic Memory Ordering Constraints
592define void @atomics(i32* %word) {
593  %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
594  ; CHECK: %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic
595  %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
596  ; CHECK: %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic
597  %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
598  ; CHECK: %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic
599  %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
600  ; CHECK: %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic
601  %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
602  ; CHECK: %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic
603  %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
604  ; CHECK: %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic
605  %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
606  ; CHECK: %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic
607  %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 singlethread seq_cst monotonic
608  ; CHECK: %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 singlethread seq_cst monotonic
609  %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
610  ; CHECK: %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic
611  %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic
612  ; CHECK: %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic
613  %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic
614  ; CHECK: %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic
615  %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic
616  ; CHECK: %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic
617  %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic
618  ; CHECK: %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic
619  %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic
620  ; CHECK: %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic
621  %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic
622  ; CHECK: %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic
623  %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic
624  ; CHECK: %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic
625  %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic
626  ; CHECK: %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic
627  %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 singlethread monotonic
628  ; CHECK: %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 singlethread monotonic
629  %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 singlethread monotonic
630  ; CHECK: %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 singlethread monotonic
631  fence acquire
632  ; CHECK: fence acquire
633  fence release
634  ; CHECK: fence release
635  fence acq_rel
636  ; CHECK: fence acq_rel
637  fence singlethread seq_cst
638  ; CHECK: fence singlethread seq_cst
639
640  %ld.1 = load atomic i32, i32* %word monotonic, align 4
641  ; CHECK: %ld.1 = load atomic i32, i32* %word monotonic, align 4
642  %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
643  ; CHECK: %ld.2 = load atomic volatile i32, i32* %word acquire, align 8
644  %ld.3 = load atomic volatile i32, i32* %word singlethread seq_cst, align 16
645  ; CHECK: %ld.3 = load atomic volatile i32, i32* %word singlethread seq_cst, align 16
646
647  store atomic i32 23, i32* %word monotonic, align 4
648  ; CHECK: store atomic i32 23, i32* %word monotonic, align 4
649  store atomic volatile i32 24, i32* %word monotonic, align 4
650  ; CHECK: store atomic volatile i32 24, i32* %word monotonic, align 4
651  store atomic volatile i32 25, i32* %word singlethread monotonic, align 4
652  ; CHECK: store atomic volatile i32 25, i32* %word singlethread monotonic, align 4
653  ret void
654}
655
656;; Fast Math Flags
657define void @fastmathflags(float %op1, float %op2) {
658  %f.nnan = fadd nnan float %op1, %op2
659  ; CHECK: %f.nnan = fadd nnan float %op1, %op2
660  %f.ninf = fadd ninf float %op1, %op2
661  ; CHECK: %f.ninf = fadd ninf float %op1, %op2
662  %f.nsz = fadd nsz float %op1, %op2
663  ; CHECK: %f.nsz = fadd nsz float %op1, %op2
664  %f.arcp = fadd arcp float %op1, %op2
665  ; CHECK: %f.arcp = fadd arcp float %op1, %op2
666  %f.fast = fadd fast float %op1, %op2
667  ; CHECK: %f.fast = fadd fast float %op1, %op2
668  ret void
669}
670
671; Check various fast math flags and floating-point types on calls.
672
673declare float @fmf1()
674declare double @fmf2()
675declare <4 x double> @fmf3()
676
677; CHECK-LABEL: fastMathFlagsForCalls(
678define void @fastMathFlagsForCalls(float %f, double %d1, <4 x double> %d2) {
679  %call.fast = call fast float @fmf1()
680  ; CHECK: %call.fast = call fast float @fmf1()
681
682  ; Throw in some other attributes to make sure those stay in the right places.
683
684  %call.nsz.arcp = notail call nsz arcp double @fmf2()
685  ; CHECK: %call.nsz.arcp = notail call nsz arcp double @fmf2()
686
687  %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
688  ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
689
690  ret void
691}
692
693;; Type System
694%opaquety = type opaque
695define void @typesystem() {
696  %p0 = bitcast i8* null to i32 (i32)*
697  ; CHECK: %p0 = bitcast i8* null to i32 (i32)*
698  %p1 = bitcast i8* null to void (i8*)*
699  ; CHECK: %p1 = bitcast i8* null to void (i8*)*
700  %p2 = bitcast i8* null to i32 (i8*, ...)*
701  ; CHECK: %p2 = bitcast i8* null to i32 (i8*, ...)*
702  %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
703  ; CHECK: %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)*
704  %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
705  ; CHECK: %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)*
706  %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
707  ; CHECK: %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)*
708
709  %t0 = alloca i1942652
710  ; CHECK: %t0 = alloca i1942652
711  %t1 = alloca half
712  ; CHECK: %t1 = alloca half
713  %t2 = alloca float
714  ; CHECK: %t2 = alloca float
715  %t3 = alloca double
716  ; CHECK: %t3 = alloca double
717  %t4 = alloca fp128
718  ; CHECK: %t4 = alloca fp128
719  %t5 = alloca x86_fp80
720  ; CHECK: %t5 = alloca x86_fp80
721  %t6 = alloca ppc_fp128
722  ; CHECK: %t6 = alloca ppc_fp128
723  %t7 = alloca x86_mmx
724  ; CHECK: %t7 = alloca x86_mmx
725  %t8 = alloca %opaquety*
726  ; CHECK: %t8 = alloca %opaquety*
727
728  ret void
729}
730
731declare void @llvm.token(token)
732; CHECK: declare void @llvm.token(token)
733
734;; Inline Assembler Expressions
735define void @inlineasm(i32 %arg) {
736  call i32 asm "bswap $0", "=r,r"(i32 %arg)
737  ; CHECK: call i32 asm "bswap $0", "=r,r"(i32 %arg)
738  call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
739  ; CHECK: call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg)
740  ret void
741}
742
743;; Instructions
744
745; Instructions -- Terminators
746define void @instructions.terminators(i8 %val) personality i32 -10 {
747  br i1 false, label %iftrue, label %iffalse
748  ; CHECK: br i1 false, label %iftrue, label %iffalse
749  br label %iftrue
750  ; CHECK: br label %iftrue
751iftrue:
752  ret void
753  ; CHECK: ret void
754iffalse:
755
756  switch i8 %val, label %defaultdest [
757  ; CHECK: switch i8 %val, label %defaultdest [
758         i8 0, label %defaultdest.0
759         ; CHECK: i8 0, label %defaultdest.0
760         i8 1, label %defaultdest.1
761         ; CHECK: i8 1, label %defaultdest.1
762         i8 2, label %defaultdest.2
763         ; CHECK: i8 2, label %defaultdest.2
764  ]
765  ; CHECK: ]
766defaultdest:
767  ret void
768defaultdest.0:
769  ret void
770defaultdest.1:
771  ret void
772defaultdest.2:
773
774  indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
775  ; CHECK: indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2]
776  indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
777  ; CHECK: indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2]
778
779  invoke fastcc void @f.fastcc()
780  ; CHECK: invoke fastcc void @f.fastcc()
781         to label %defaultdest unwind label %exc
782         ; CHECK: to label %defaultdest unwind label %exc
783exc:
784  %cleanup = landingpad i32 cleanup
785
786  resume i32 undef
787  ; CHECK: resume i32 undef
788  unreachable
789  ; CHECK: unreachable
790
791  ret void
792}
793
794define i32 @instructions.win_eh.1() personality i32 -3 {
795entry:
796  %arg1 = alloca i32
797  %arg2 = alloca i32
798  invoke void @f.ccc() to label %normal unwind label %catchswitch1
799  invoke void @f.ccc() to label %normal unwind label %catchswitch2
800  invoke void @f.ccc() to label %normal unwind label %catchswitch3
801
802catchswitch1:
803  %cs1 = catchswitch within none [label %catchpad1] unwind to caller
804
805catchpad1:
806  catchpad within %cs1 []
807  br label %normal
808  ; CHECK: catchpad within %cs1 []
809  ; CHECK-NEXT: br label %normal
810
811catchswitch2:
812  %cs2 = catchswitch within none [label %catchpad2] unwind to caller
813
814catchpad2:
815  catchpad within %cs2 [i32* %arg1]
816  br label %normal
817  ; CHECK: catchpad within %cs2 [i32* %arg1]
818  ; CHECK-NEXT: br label %normal
819
820catchswitch3:
821  %cs3 = catchswitch within none [label %catchpad3] unwind label %cleanuppad1
822
823catchpad3:
824  catchpad within %cs3 [i32* %arg1, i32* %arg2]
825  br label %normal
826  ; CHECK: catchpad within %cs3 [i32* %arg1, i32* %arg2]
827  ; CHECK-NEXT: br label %normal
828
829cleanuppad1:
830  %clean.1 = cleanuppad within none []
831  unreachable
832  ; CHECK: %clean.1 = cleanuppad within none []
833  ; CHECK-NEXT: unreachable
834
835normal:
836  ret i32 0
837}
838;
839define i32 @instructions.win_eh.2() personality i32 -4 {
840entry:
841  invoke void @f.ccc() to label %invoke.cont unwind label %catchswitch
842
843invoke.cont:
844  invoke void @f.ccc() to label %continue unwind label %cleanup
845
846cleanup:
847  %clean = cleanuppad within none []
848  ; CHECK: %clean = cleanuppad within none []
849  cleanupret from %clean unwind to caller
850  ; CHECK: cleanupret from %clean unwind to caller
851
852catchswitch:
853  %cs = catchswitch within none [label %catchpad] unwind label %terminate
854
855catchpad:
856  %catch = catchpad within %cs []
857  br label %body
858  ; CHECK: %catch = catchpad within %cs []
859  ; CHECK-NEXT: br label %body
860
861body:
862  invoke void @f.ccc() to label %continue unwind label %terminate
863  catchret from %catch to label %return
864  ; CHECK: catchret from %catch to label %return
865
866return:
867  ret i32 0
868
869terminate:
870  cleanuppad within %cs []
871  unreachable
872  ; CHECK: cleanuppad within %cs []
873  ; CHECK-NEXT: unreachable
874
875continue:
876  ret i32 0
877}
878
879; Instructions -- Binary Operations
880define void @instructions.binops(i8 %op1, i8 %op2) {
881  ; nuw x nsw
882  add i8 %op1, %op2
883  ; CHECK: add i8 %op1, %op2
884  add nuw i8 %op1, %op2
885  ; CHECK: add nuw i8 %op1, %op2
886  add nsw i8 %op1, %op2
887  ; CHECK: add nsw i8 %op1, %op2
888  add nuw nsw i8 %op1, %op2
889  ; CHECK: add nuw nsw i8 %op1, %op2
890  sub i8 %op1, %op2
891  ; CHECK: sub i8 %op1, %op2
892  sub nuw i8 %op1, %op2
893  ; CHECK: sub nuw i8 %op1, %op2
894  sub nsw i8 %op1, %op2
895  ; CHECK: sub nsw i8 %op1, %op2
896  sub nuw nsw i8 %op1, %op2
897  ; CHECK: sub nuw nsw i8 %op1, %op2
898  mul i8 %op1, %op2
899  ; CHECK: mul i8 %op1, %op2
900  mul nuw i8 %op1, %op2
901  ; CHECK: mul nuw i8 %op1, %op2
902  mul nsw i8 %op1, %op2
903  ; CHECK: mul nsw i8 %op1, %op2
904  mul nuw nsw i8 %op1, %op2
905  ; CHECK: mul nuw nsw i8 %op1, %op2
906
907  ; exact
908  udiv i8 %op1, %op2
909  ; CHECK: udiv i8 %op1, %op2
910  udiv exact i8 %op1, %op2
911  ; CHECK: udiv exact i8 %op1, %op2
912  sdiv i8 %op1, %op2
913  ; CHECK: sdiv i8 %op1, %op2
914  sdiv exact i8 %op1, %op2
915  ; CHECK: sdiv exact i8 %op1, %op2
916
917  ; none
918  urem i8 %op1, %op2
919  ; CHECK: urem i8 %op1, %op2
920  srem i8 %op1, %op2
921  ; CHECK: srem i8 %op1, %op2
922
923  ret void
924}
925
926; Instructions -- Bitwise Binary Operations
927define void @instructions.bitwise_binops(i8 %op1, i8 %op2) {
928  ; nuw x nsw
929  shl i8 %op1, %op2
930  ; CHECK: shl i8 %op1, %op2
931  shl nuw i8 %op1, %op2
932  ; CHECK: shl nuw i8 %op1, %op2
933  shl nsw i8 %op1, %op2
934  ; CHECK: shl nsw i8 %op1, %op2
935  shl nuw nsw i8 %op1, %op2
936  ; CHECK: shl nuw nsw i8 %op1, %op2
937
938  ; exact
939  lshr i8 %op1, %op2
940  ; CHECK: lshr i8 %op1, %op2
941  lshr exact i8 %op1, %op2
942  ; CHECK: lshr exact i8 %op1, %op2
943  ashr i8 %op1, %op2
944  ; CHECK: ashr i8 %op1, %op2
945  ashr exact i8 %op1, %op2
946  ; CHECK: ashr exact i8 %op1, %op2
947
948  ; none
949  and i8 %op1, %op2
950  ; CHECK: and i8 %op1, %op2
951  or i8 %op1, %op2
952  ; CHECK: or i8 %op1, %op2
953  xor i8 %op1, %op2
954  ; CHECK: xor i8 %op1, %op2
955
956  ret void
957}
958
959; Instructions -- Vector Operations
960define void @instructions.vectorops(<4 x float> %vec, <4 x float> %vec2) {
961  extractelement <4 x float> %vec, i8 0
962  ; CHECK: extractelement <4 x float> %vec, i8 0
963  insertelement <4 x float> %vec, float 3.500000e+00, i8 0
964  ; CHECK: insertelement <4 x float> %vec, float 3.500000e+00, i8 0
965  shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
966  ; CHECK: shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer
967
968  ret void
969}
970
971; Instructions -- Aggregate Operations
972define void @instructions.aggregateops({ i8, i32 } %up, <{ i8, i32 }> %p,
973                                       [3 x i8] %arr, { i8, { i32 }} %n,
974                                       <2 x i8*> %pvec, <2 x i64> %offsets) {
975  extractvalue { i8, i32 } %up, 0
976  ; CHECK: extractvalue { i8, i32 } %up, 0
977  extractvalue <{ i8, i32 }> %p, 1
978  ; CHECK: extractvalue <{ i8, i32 }> %p, 1
979  extractvalue [3 x i8] %arr, 2
980  ; CHECK: extractvalue [3 x i8] %arr, 2
981  extractvalue { i8, { i32 } } %n, 1, 0
982  ; CHECK: extractvalue { i8, { i32 } } %n, 1, 0
983
984  insertvalue { i8, i32 } %up, i8 1, 0
985  ; CHECK: insertvalue { i8, i32 } %up, i8 1, 0
986  insertvalue <{ i8, i32 }> %p, i32 2, 1
987  ; CHECK: insertvalue <{ i8, i32 }> %p, i32 2, 1
988  insertvalue [3 x i8] %arr, i8 0, 0
989  ; CHECK: insertvalue [3 x i8] %arr, i8 0, 0
990  insertvalue { i8, { i32 } } %n, i32 0, 1, 0
991  ; CHECK: insertvalue { i8, { i32 } } %n, i32 0, 1, 0
992
993  %up.ptr = alloca { i8, i32 }
994  %p.ptr = alloca <{ i8, i32 }>
995  %arr.ptr = alloca [3 x i8]
996  %n.ptr = alloca { i8, { i32 } }
997
998  getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
999  ; CHECK: getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0
1000  getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
1001  ; CHECK: getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1
1002  getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
1003  ; CHECK: getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2
1004  getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
1005  ; CHECK: getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1
1006  getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
1007  ; CHECK: getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0
1008  getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
1009  ; CHECK: getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets
1010
1011  ret void
1012}
1013
1014; Instructions -- Memory Access and Addressing Operations
1015!7 = !{i32 1}
1016!8 = !{}
1017!9 = !{i64 4}
1018define void @instructions.memops(i32** %base) {
1019  alloca i32, i8 4, align 4
1020  ; CHECK: alloca i32, i8 4, align 4
1021  alloca inalloca i32, i8 4, align 4
1022  ; CHECK: alloca inalloca i32, i8 4, align 4
1023
1024  load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1025  ; CHECK: load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1026  load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1027  ; CHECK: load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9
1028
1029  store i32* null, i32** %base, align 4, !nontemporal !8
1030  ; CHECK: store i32* null, i32** %base, align 4, !nontemporal !8
1031  store volatile i32* null, i32** %base, align 4, !nontemporal !8
1032  ; CHECK: store volatile i32* null, i32** %base, align 4, !nontemporal !8
1033
1034  ret void
1035}
1036
1037; Instructions -- Conversion Operations
1038define void @instructions.conversions() {
1039  trunc i32 -1 to i1
1040  ; CHECK: trunc i32 -1 to i1
1041  zext i32 -1 to i64
1042  ; CHECK: zext i32 -1 to i64
1043  sext i32 -1 to i64
1044  ; CHECK: sext i32 -1 to i64
1045  fptrunc float undef to half
1046  ; CHECK: fptrunc float undef to half
1047  fpext half undef to float
1048  ; CHECK: fpext half undef to float
1049  fptoui float undef to i32
1050  ; CHECK: fptoui float undef to i32
1051  fptosi float undef to i32
1052  ; CHECK: fptosi float undef to i32
1053  uitofp i32 1 to float
1054  ; CHECK: uitofp i32 1 to float
1055  sitofp i32 -1 to float
1056  ; CHECK: sitofp i32 -1 to float
1057  ptrtoint i8* null to i64
1058  ; CHECK: ptrtoint i8* null to i64
1059  inttoptr i64 0 to i8*
1060  ; CHECK: inttoptr i64 0 to i8*
1061  bitcast i32 0 to i32
1062  ; CHECK: bitcast i32 0 to i32
1063  addrspacecast i32* null to i32 addrspace(1)*
1064  ; CHECK: addrspacecast i32* null to i32 addrspace(1)*
1065
1066  ret void
1067}
1068
1069; Instructions -- Other Operations
1070define void @instructions.other(i32 %op1, i32 %op2, half %fop1, half %fop2) {
1071entry:
1072  icmp eq  i32 %op1, %op2
1073  ; CHECK: icmp eq  i32 %op1, %op2
1074  icmp ne  i32 %op1, %op2
1075  ; CHECK: icmp ne  i32 %op1, %op2
1076  icmp ugt i32 %op1, %op2
1077  ; CHECK: icmp ugt i32 %op1, %op2
1078  icmp uge i32 %op1, %op2
1079  ; CHECK: icmp uge i32 %op1, %op2
1080  icmp ult i32 %op1, %op2
1081  ; CHECK: icmp ult i32 %op1, %op2
1082  icmp ule i32 %op1, %op2
1083  ; CHECK: icmp ule i32 %op1, %op2
1084  icmp sgt i32 %op1, %op2
1085  ; CHECK: icmp sgt i32 %op1, %op2
1086  icmp sge i32 %op1, %op2
1087  ; CHECK: icmp sge i32 %op1, %op2
1088  icmp slt i32 %op1, %op2
1089  ; CHECK: icmp slt i32 %op1, %op2
1090  icmp sle i32 %op1, %op2
1091  ; CHECK: icmp sle i32 %op1, %op2
1092
1093  fcmp false half %fop1, %fop2
1094  ; CHECK: fcmp false half %fop1, %fop2
1095  fcmp oeq   half %fop1, %fop2
1096  ; CHECK: fcmp oeq   half %fop1, %fop2
1097  fcmp ogt   half %fop1, %fop2
1098  ; CHECK: fcmp ogt   half %fop1, %fop2
1099  fcmp oge   half %fop1, %fop2
1100  ; CHECK: fcmp oge   half %fop1, %fop2
1101  fcmp olt   half %fop1, %fop2
1102  ; CHECK: fcmp olt   half %fop1, %fop2
1103  fcmp ole   half %fop1, %fop2
1104  ; CHECK: fcmp ole   half %fop1, %fop2
1105  fcmp one   half %fop1, %fop2
1106  ; CHECK: fcmp one   half %fop1, %fop2
1107  fcmp ord   half %fop1, %fop2
1108  ; CHECK: fcmp ord   half %fop1, %fop2
1109  fcmp ueq   half %fop1, %fop2
1110  ; CHECK: fcmp ueq   half %fop1, %fop2
1111  fcmp ugt   half %fop1, %fop2
1112  ; CHECK: fcmp ugt   half %fop1, %fop2
1113  fcmp uge   half %fop1, %fop2
1114  ; CHECK: fcmp uge   half %fop1, %fop2
1115  fcmp ult   half %fop1, %fop2
1116  ; CHECK: fcmp ult   half %fop1, %fop2
1117  fcmp ule   half %fop1, %fop2
1118  ; CHECK: fcmp ule   half %fop1, %fop2
1119  fcmp une   half %fop1, %fop2
1120  ; CHECK: fcmp une   half %fop1, %fop2
1121  fcmp uno   half %fop1, %fop2
1122  ; CHECK: fcmp uno   half %fop1, %fop2
1123  fcmp true  half %fop1, %fop2
1124  ; CHECK: fcmp true  half %fop1, %fop2
1125
1126  br label %exit
1127L1:
1128  %v1 = add i32 %op1, %op2
1129  br label %exit
1130L2:
1131  %v2 = add i32 %op1, %op2
1132  br label %exit
1133exit:
1134  phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1135  ; CHECK: phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ]
1136
1137  select i1 true, i32 0, i32 1
1138  ; CHECK: select i1 true, i32 0, i32 1
1139  select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1140  ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
1141
1142  call void @f.nobuiltin() builtin
1143  ; CHECK: call void @f.nobuiltin() #39
1144
1145  call fastcc noalias i32* @f.noalias() noinline
1146  ; CHECK: call fastcc noalias i32* @f.noalias() #12
1147  tail call ghccc nonnull i32* @f.nonnull() minsize
1148  ; CHECK: tail call ghccc nonnull i32* @f.nonnull() #7
1149
1150  ret void
1151}
1152
1153define void @instructions.call_musttail(i8* inalloca %val) {
1154  musttail call void @f.param.inalloca(i8* inalloca %val)
1155  ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val)
1156
1157  ret void
1158}
1159
1160define void @instructions.call_notail() {
1161  notail call void @f1()
1162  ; CHECK: notail call void @f1()
1163
1164  ret void
1165}
1166
1167define void @instructions.landingpad() personality i32 -2 {
1168  invoke void @llvm.donothing() to label %proceed unwind label %catch1
1169  invoke void @llvm.donothing() to label %proceed unwind label %catch2
1170  invoke void @llvm.donothing() to label %proceed unwind label %catch3
1171  invoke void @llvm.donothing() to label %proceed unwind label %catch4
1172
1173catch1:
1174  landingpad i32
1175  ; CHECK: landingpad i32
1176             cleanup
1177             ; CHECK: cleanup
1178  br label %proceed
1179
1180catch2:
1181  landingpad i32
1182  ; CHECK: landingpad i32
1183             cleanup
1184             ; CHECK: cleanup
1185             catch i32* null
1186             ; CHECK: catch i32* null
1187  br label %proceed
1188
1189catch3:
1190  landingpad i32
1191  ; CHECK: landingpad i32
1192             cleanup
1193             ; CHECK: cleanup
1194             catch i32* null
1195             ; CHECK: catch i32* null
1196             catch i32* null
1197             ; CHECK: catch i32* null
1198  br label %proceed
1199
1200catch4:
1201  landingpad i32
1202  ; CHECK: landingpad i32
1203             filter [2 x i32] zeroinitializer
1204             ; CHECK: filter [2 x i32] zeroinitializer
1205  br label %proceed
1206
1207proceed:
1208  ret void
1209}
1210
1211;; Intrinsic Functions
1212
1213; Intrinsic Functions -- Variable Argument Handling
1214declare void @llvm.va_start(i8*)
1215declare void @llvm.va_copy(i8*, i8*)
1216declare void @llvm.va_end(i8*)
1217define void @instructions.va_arg(i8* %v, ...) {
1218  %ap = alloca i8*
1219  %ap2 = bitcast i8** %ap to i8*
1220
1221  call void @llvm.va_start(i8* %ap2)
1222  ; CHECK: call void @llvm.va_start(i8* %ap2)
1223
1224  va_arg i8* %ap2, i32
1225  ; CHECK: va_arg i8* %ap2, i32
1226
1227  call void @llvm.va_copy(i8* %v, i8* %ap2)
1228  ; CHECK: call void @llvm.va_copy(i8* %v, i8* %ap2)
1229
1230  call void @llvm.va_end(i8* %ap2)
1231  ; CHECK: call void @llvm.va_end(i8* %ap2)
1232
1233  ret void
1234}
1235
1236; Intrinsic Functions -- Accurate Garbage Collection
1237declare void @llvm.gcroot(i8**, i8*)
1238declare i8* @llvm.gcread(i8*, i8**)
1239declare void @llvm.gcwrite(i8*, i8*, i8**)
1240define void @intrinsics.gc() gc "shadow-stack" {
1241  %ptrloc = alloca i8*
1242  call void @llvm.gcroot(i8** %ptrloc, i8* null)
1243  ; CHECK: call void @llvm.gcroot(i8** %ptrloc, i8* null)
1244
1245  call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1246  ; CHECK: call i8* @llvm.gcread(i8* null, i8** %ptrloc)
1247
1248  %ref = alloca i8
1249  call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1250  ; CHECK: call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc)
1251
1252  ret void
1253}
1254
1255; Intrinsic Functions -- Code Generation
1256declare i8* @llvm.returnaddress(i32)
1257declare i8* @llvm.frameaddress(i32)
1258declare i32 @llvm.read_register.i32(metadata)
1259declare i64 @llvm.read_register.i64(metadata)
1260declare void @llvm.write_register.i32(metadata, i32)
1261declare void @llvm.write_register.i64(metadata, i64)
1262declare i8* @llvm.stacksave()
1263declare void @llvm.stackrestore(i8*)
1264declare void @llvm.prefetch(i8*, i32, i32, i32)
1265declare void @llvm.pcmarker(i32)
1266declare i64 @llvm.readcyclecounter()
1267declare void @llvm.clear_cache(i8*, i8*)
1268declare void @llvm.instrprof_increment(i8*, i64, i32, i32)
1269
1270!10 = !{!"rax"}
1271define void @intrinsics.codegen() {
1272  call i8* @llvm.returnaddress(i32 1)
1273  ; CHECK: call i8* @llvm.returnaddress(i32 1)
1274  call i8* @llvm.frameaddress(i32 1)
1275  ; CHECK: call i8* @llvm.frameaddress(i32 1)
1276
1277  call i32 @llvm.read_register.i32(metadata !10)
1278  ; CHECK: call i32 @llvm.read_register.i32(metadata !10)
1279  call i64 @llvm.read_register.i64(metadata !10)
1280  ; CHECK: call i64 @llvm.read_register.i64(metadata !10)
1281  call void @llvm.write_register.i32(metadata !10, i32 0)
1282  ; CHECK: call void @llvm.write_register.i32(metadata !10, i32 0)
1283  call void @llvm.write_register.i64(metadata !10, i64 0)
1284  ; CHECK: call void @llvm.write_register.i64(metadata !10, i64 0)
1285
1286  %stack = call i8* @llvm.stacksave()
1287  ; CHECK: %stack = call i8* @llvm.stacksave()
1288  call void @llvm.stackrestore(i8* %stack)
1289  ; CHECK: call void @llvm.stackrestore(i8* %stack)
1290
1291  call void @llvm.prefetch(i8* %stack, i32 0, i32 3, i32 0)
1292  ; CHECK: call void @llvm.prefetch(i8* %stack, i32 0, i32 3, i32 0)
1293
1294  call void @llvm.pcmarker(i32 1)
1295  ; CHECK: call void @llvm.pcmarker(i32 1)
1296
1297  call i64 @llvm.readcyclecounter()
1298  ; CHECK: call i64 @llvm.readcyclecounter()
1299
1300  call void @llvm.clear_cache(i8* null, i8* null)
1301  ; CHECK: call void @llvm.clear_cache(i8* null, i8* null)
1302
1303  call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1304  ; CHECK: call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0)
1305
1306  ret void
1307}
1308
1309declare void @llvm.localescape(...)
1310declare i8* @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
1311define void @intrinsics.localescape() {
1312  %static.alloca = alloca i32
1313  call void (...) @llvm.localescape(i32* %static.alloca)
1314  ; CHECK: call void (...) @llvm.localescape(i32* %static.alloca)
1315
1316  call void @intrinsics.localrecover()
1317
1318  ret void
1319}
1320define void @intrinsics.localrecover() {
1321  %func = bitcast void ()* @intrinsics.localescape to i8*
1322  %fp = call i8* @llvm.frameaddress(i32 1)
1323  call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1324  ; CHECK: call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0)
1325
1326  ret void
1327}
1328
1329; We need this function to provide `uses' for some metadata tests.
1330define void @misc.metadata() {
1331  call void @f1(), !srcloc !11
1332  call void @f1(), !srcloc !12
1333  call void @f1(), !srcloc !13
1334  call void @f1(), !srcloc !14
1335  ret void
1336}
1337
1338declare void @op_bundle_callee_0()
1339declare void @op_bundle_callee_1(i32,i32)
1340
1341define void @call_with_operand_bundle0(i32* %ptr) {
1342; CHECK-LABEL: call_with_operand_bundle0(
1343 entry:
1344  %l = load i32, i32* %ptr
1345  %x = add i32 42, 1
1346  call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float  0.000000e+00, i64 100, i32 %l) ]
1347; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float  0.000000e+00, i64 100, i32 %l) ]
1348  ret void
1349}
1350
1351define void @call_with_operand_bundle1(i32* %ptr) {
1352; CHECK-LABEL: call_with_operand_bundle1(
1353 entry:
1354  %l = load i32, i32* %ptr
1355  %x = add i32 42, 1
1356
1357  call void @op_bundle_callee_0()
1358  call void @op_bundle_callee_0() [ "foo"() ]
1359  call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float  0.000000e+00, i64 100, i32 %l) ]
1360; CHECK: @op_bundle_callee_0(){{$}}
1361; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"() ]
1362; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float  0.000000e+00, i64 100, i32 %l) ]
1363  ret void
1364}
1365
1366define void @call_with_operand_bundle2(i32* %ptr) {
1367; CHECK-LABEL: call_with_operand_bundle2(
1368 entry:
1369  call void @op_bundle_callee_0() [ "foo"() ]
1370; CHECK: call void @op_bundle_callee_0() [ "foo"() ]
1371  ret void
1372}
1373
1374define void @call_with_operand_bundle3(i32* %ptr) {
1375; CHECK-LABEL: call_with_operand_bundle3(
1376 entry:
1377  %l = load i32, i32* %ptr
1378  %x = add i32 42, 1
1379  call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float  0.000000e+00, i32 %l) ]
1380; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float  0.000000e+00, i32 %l) ]
1381  ret void
1382}
1383
1384define void @call_with_operand_bundle4(i32* %ptr) {
1385; CHECK-LABEL: call_with_operand_bundle4(
1386 entry:
1387  %l = load i32, i32* %ptr
1388  %x = add i32 42, 1
1389  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) ]
1390; 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) ]
1391  ret void
1392}
1393
1394; Invoke versions of the above tests:
1395
1396
1397define void @invoke_with_operand_bundle0(i32* %ptr) personality i8 3 {
1398; CHECK-LABEL: @invoke_with_operand_bundle0(
1399 entry:
1400  %l = load i32, i32* %ptr
1401  %x = add i32 42, 1
1402  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
1403; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float  0.000000e+00, i64 100, i32 %l) ]
1404
1405exception:
1406  %cleanup = landingpad i8 cleanup
1407  br label %normal
1408normal:
1409  ret void
1410}
1411
1412define void @invoke_with_operand_bundle1(i32* %ptr) personality i8 3 {
1413; CHECK-LABEL: @invoke_with_operand_bundle1(
1414 entry:
1415  %l = load i32, i32* %ptr
1416  %x = add i32 42, 1
1417
1418  invoke void @op_bundle_callee_0() to label %normal unwind label %exception
1419; CHECK: invoke void @op_bundle_callee_0(){{$}}
1420
1421exception:
1422  %cleanup = landingpad i8 cleanup
1423  br label %normal
1424
1425normal:
1426  invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal1 unwind label %exception1
1427; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1428
1429exception1:
1430  %cleanup1 = landingpad i8 cleanup
1431  br label %normal1
1432
1433normal1:
1434  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
1435; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float  0.000000e+00, i32 %l) ]
1436
1437exception2:
1438  %cleanup2 = landingpad i8 cleanup
1439  br label %normal2
1440
1441normal2:
1442  ret void
1443}
1444
1445define void @invoke_with_operand_bundle2(i32* %ptr) personality i8 3 {
1446; CHECK-LABEL: @invoke_with_operand_bundle2(
1447 entry:
1448  invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal unwind label %exception
1449; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ]
1450
1451exception:
1452  %cleanup = landingpad i8 cleanup
1453  br label %normal
1454normal:
1455  ret void
1456}
1457
1458define void @invoke_with_operand_bundle3(i32* %ptr) personality i8 3 {
1459; CHECK-LABEL: @invoke_with_operand_bundle3(
1460 entry:
1461  %l = load i32, i32* %ptr
1462  %x = add i32 42, 1
1463  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
1464; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float  0.000000e+00, i32 %l) ]
1465
1466exception:
1467  %cleanup = landingpad i8 cleanup
1468  br label %normal
1469normal:
1470  ret void
1471}
1472
1473define void @invoke_with_operand_bundle4(i32* %ptr) personality i8 3 {
1474; CHECK-LABEL: @invoke_with_operand_bundle4(
1475 entry:
1476  %l = load i32, i32* %ptr
1477  %x = add i32 42, 1
1478  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) ]
1479        to label %normal unwind label %exception
1480; 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) ]
1481
1482exception:
1483  %cleanup = landingpad i8 cleanup
1484  br label %normal
1485normal:
1486  ret void
1487}
1488
1489
1490; CHECK: attributes #0 = { alignstack=4 }
1491; CHECK: attributes #1 = { alignstack=8 }
1492; CHECK: attributes #2 = { alwaysinline }
1493; CHECK: attributes #3 = { cold }
1494; CHECK: attributes #4 = { convergent }
1495; CHECK: attributes #5 = { inlinehint }
1496; CHECK: attributes #6 = { jumptable }
1497; CHECK: attributes #7 = { minsize }
1498; CHECK: attributes #8 = { naked }
1499; CHECK: attributes #9 = { nobuiltin }
1500; CHECK: attributes #10 = { noduplicate }
1501; CHECK: attributes #11 = { noimplicitfloat }
1502; CHECK: attributes #12 = { noinline }
1503; CHECK: attributes #13 = { nonlazybind }
1504; CHECK: attributes #14 = { noredzone }
1505; CHECK: attributes #15 = { noreturn }
1506; CHECK: attributes #16 = { nounwind }
1507; CHECK: attributes #17 = { noinline optnone }
1508; CHECK: attributes #18 = { optsize }
1509; CHECK: attributes #19 = { readnone }
1510; CHECK: attributes #20 = { readonly }
1511; CHECK: attributes #21 = { returns_twice }
1512; CHECK: attributes #22 = { safestack }
1513; CHECK: attributes #23 = { sanitize_address }
1514; CHECK: attributes #24 = { sanitize_memory }
1515; CHECK: attributes #25 = { sanitize_thread }
1516; CHECK: attributes #26 = { ssp }
1517; CHECK: attributes #27 = { sspreq }
1518; CHECK: attributes #28 = { sspstrong }
1519; CHECK: attributes #29 = { "thunk" }
1520; CHECK: attributes #30 = { uwtable }
1521; CHECK: attributes #31 = { "cpu"="cortex-a8" }
1522; CHECK: attributes #32 = { norecurse }
1523; CHECK: attributes #33 = { inaccessiblememonly }
1524; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly }
1525; CHECK: attributes #35 = { nounwind readnone }
1526; CHECK: attributes #36 = { argmemonly nounwind readonly }
1527; CHECK: attributes #37 = { argmemonly nounwind }
1528; CHECK: attributes #38 = { nounwind readonly }
1529; CHECK: attributes #39 = { builtin }
1530
1531;; Metadata
1532
1533; Metadata -- Module flags
1534!llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1535; CHECK: !llvm.module.flags = !{!0, !1, !2, !4, !5, !6}
1536
1537!0 = !{i32 1, !"mod1", i32 0}
1538; CHECK: !0 = !{i32 1, !"mod1", i32 0}
1539!1 = !{i32 2, !"mod2", i32 0}
1540; CHECK: !1 = !{i32 2, !"mod2", i32 0}
1541!2 = !{i32 3, !"mod3", !3}
1542; CHECK: !2 = !{i32 3, !"mod3", !3}
1543!3 = !{!"mod6", !0}
1544; CHECK: !3 = !{!"mod6", !0}
1545!4 = !{i32 4, !"mod4", i32 0}
1546; CHECK: !4 = !{i32 4, !"mod4", i32 0}
1547!5 = !{i32 5, !"mod5", !0}
1548; CHECK: !5 = !{i32 5, !"mod5", !0}
1549!6 = !{i32 6, !"mod6", !0}
1550; CHECK: !6 = !{i32 6, !"mod6", !0}
1551
1552; Metadata -- Check `distinct'
1553!11 = distinct !{}
1554; CHECK: !11 = distinct !{}
1555!12 = distinct !{}
1556; CHECK: !12 = distinct !{}
1557!13 = !{!11}
1558; CHECK: !13 = !{!11}
1559!14 = !{!12}
1560; CHECK: !14 = !{!12}
1561