source: icGREP/icgrep-devel/llvm-3.8.0.src/test/Bitcode/compatibility.ll @ 5027

Last change on this file since 5027 was 5027, checked in by cameron, 3 years ago

Upgrade to llvm 3.8

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