1; RUN: llvm-as < %s | llvm-dis | FileCheck %s
2; RUN: verify-uselistorder < %s
3; PR12696
4
5define void @f1(i8 zeroext)
6; CHECK: define void @f1(i8 zeroext)
7{
8        ret void;
9}
10
11define void @f2(i8 signext)
12; CHECK: define void @f2(i8 signext)
13{
14        ret void;
15}
16
17define void @f3() noreturn
18; CHECK: define void @f3() #0
19{
20        ret void;
21}
22
23define void @f4(i8 inreg)
24; CHECK: define void @f4(i8 inreg)
25{
26        ret void;
27}
28
29define void @f5(i8* sret)
30; CHECK: define void @f5(i8* sret)
31{
32        ret void;
33}
34
35define void @f6() nounwind
36; CHECK: define void @f6() #1
37{
38        ret void;
39}
40
41define void @f7(i8* noalias)
42; CHECK: define void @f7(i8* noalias)
43{
44        ret void;
45}
46
47define void @f8(i8* byval)
48; CHECK: define void @f8(i8* byval)
49{
50        ret void;
51}
52
53define void @f9(i8* nest)
54; CHECK: define void @f9(i8* nest)
55{
56        ret void;
57}
58
59define void @f10() readnone
60; CHECK: define void @f10() #2
61{
62        ret void;
63}
64
65define void @f11() readonly
66; CHECK: define void @f11() #3
67{
68        ret void;
69}
70
71define void @f12() noinline
72; CHECK: define void @f12() #4
73{
74        ret void;
75}
76
77define void @f13() alwaysinline
78; CHECK: define void @f13() #5
79{
80        ret void;
81}
82
83define void @f14() optsize
84; CHECK: define void @f14() #6
85{
86        ret void;
87}
88
89define void @f15() ssp
90; CHECK: define void @f15() #7
91{
92        ret void;
93}
94
95define void @f16() sspreq
96; CHECK: define void @f16() #8
97{
98        ret void;
99}
100
101define void @f17(i8 align 4)
102; CHECK: define void @f17(i8 align 4)
103{
104        ret void;
105}
106
107define void @f18(i8* nocapture)
108; CHECK: define void @f18(i8* nocapture)
109{
110        ret void;
111}
112
113define void @f19() noredzone
114; CHECK: define void @f19() #9
115{
116        ret void;
117}
118
119define void @f20() noimplicitfloat
120; CHECK: define void @f20() #10
121{
122        ret void;
123}
124
125define void @f21() naked
126; CHECK: define void @f21() #11
127{
128        ret void;
129}
130
131define void @f22() inlinehint
132; CHECK: define void @f22() #12
133{
134        ret void;
135}
136
137define void @f23() alignstack(4)
138; CHECK: define void @f23() #13
139{
140        ret void;
141}
142
143define void @f24() returns_twice
144; CHECK: define void @f24() #14
145{
146        ret void;
147}
148
149define void @f25() uwtable
150; CHECK: define void @f25() #15
151{
152        ret void;
153}
154
155define void @f26() nonlazybind
156; CHECK: define void @f26() #16
157{
158        ret void;
159}
160
161define void @f27() sanitize_address
162; CHECK: define void @f27() #17
163{
164        ret void;
165}
166define void @f28() sanitize_thread
167; CHECK: define void @f28() #18
168{
169        ret void;
170}
171define void @f29() sanitize_memory
172; CHECK: define void @f29() #19
173{
174        ret void;
175}
176
177define void @f30() "cpu"="cortex-a8"
178; CHECK: define void @f30() #20
179{
180        ret void;
181}
182
183define i8 @f31(i8 returned %A)
184; CHECK: define i8 @f31(i8 returned %A)
185{
186        ret i8 %A;
187}
188
189define void @f32() sspstrong
190; CHECK: define void @f32() #21
191{
192        ret void;
193}
194
195define void @f33() minsize
196; CHECK: define void @f33() #22
197{
198        ret void;
199}
200
201declare void @nobuiltin()
202
203define void @f34()
204; CHECK: define void @f34()
205{
206        call void @nobuiltin() nobuiltin
207; CHECK: call void @nobuiltin() #30
208        ret void;
209}
210
211define void @f35() optnone noinline
212; CHECK: define void @f35() #23
213{
214        ret void;
215}
216
217define void @f36(i8* inalloca) {
218; CHECK: define void @f36(i8* inalloca) {
219        ret void
220}
221
222define nonnull i8* @f37(i8* nonnull %a) {
223; CHECK: define nonnull i8* @f37(i8* nonnull %a) {
224        ret i8* %a
225}
226
227define void @f38() unnamed_addr jumptable {
228; CHECK: define void @f38() unnamed_addr #24
229    call void bitcast (void (i8*)* @f36 to void ()*)()
230    unreachable
231}
232
233define dereferenceable(2) i8* @f39(i8* dereferenceable(1) %a) {
234; CHECK: define dereferenceable(2) i8* @f39(i8* dereferenceable(1) %a) {
235        ret i8* %a
236}
237
238define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(18446744073709551615) %a) {
239; CHECK: define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(18446744073709551615) %a) {
240        ret i8* %a
241}
242
243define void @f41(i8* align 32, double* align 64) {
244; CHECK: define void @f41(i8* align 32, double* align 64) {
245        ret void
246}
247
248; CHECK: define dereferenceable_or_null(8) i8* @f42(i8* dereferenceable_or_null(8) %foo)
249define dereferenceable_or_null(8) i8* @f42(i8* dereferenceable_or_null(8) %foo) {
250 entry:
251  ret i8* %foo
252}
253
254; CHECK: define void @f43() #25
255define void @f43() convergent {
256  ret void
257}
258
259define void @f44() argmemonly
260; CHECK: define void @f44() #26
261{
262        ret void;
263}
264
265; CHECK: define "string_attribute" void @f45(i32 "string_attribute")
266define "string_attribute" void @f45(i32 "string_attribute") {
267  ret void
268}
269
270; CHECK: define "string_attribute_with_value"="value" void @f46(i32 "string_attribute_with_value"="value")
271define "string_attribute_with_value"="value" void @f46(i32 "string_attribute_with_value"="value") {
272  ret void
273}
274
275; CHECK: define void @f47() #27
276define void @f47() norecurse {
277  ret void
278}
279
280; CHECK: define void @f48() #28
281define void @f48() inaccessiblememonly {
282  ret void
283}
284
285; CHECK: define void @f49() #29
286define void @f49() inaccessiblemem_or_argmemonly {
287  ret void
288}
289
290; CHECK: attributes #0 = { noreturn }
291; CHECK: attributes #1 = { nounwind }
292; CHECK: attributes #2 = { readnone }
293; CHECK: attributes #3 = { readonly }
294; CHECK: attributes #4 = { noinline }
295; CHECK: attributes #5 = { alwaysinline }
296; CHECK: attributes #6 = { optsize }
297; CHECK: attributes #7 = { ssp }
298; CHECK: attributes #8 = { sspreq }
299; CHECK: attributes #9 = { noredzone }
300; CHECK: attributes #10 = { noimplicitfloat }
301; CHECK: attributes #11 = { naked }
302; CHECK: attributes #12 = { inlinehint }
303; CHECK: attributes #13 = { alignstack=4 }
304; CHECK: attributes #14 = { returns_twice }
305; CHECK: attributes #15 = { uwtable }
306; CHECK: attributes #16 = { nonlazybind }
307; CHECK: attributes #17 = { sanitize_address }
308; CHECK: attributes #18 = { sanitize_thread }
309; CHECK: attributes #19 = { sanitize_memory }
310; CHECK: attributes #20 = { "cpu"="cortex-a8" }
311; CHECK: attributes #21 = { sspstrong }
312; CHECK: attributes #22 = { minsize }
313; CHECK: attributes #23 = { noinline optnone }
314; CHECK: attributes #24 = { jumptable }
315; CHECK: attributes #25 = { convergent }
316; CHECK: attributes #26 = { argmemonly }
317; CHECK: attributes #27 = { norecurse }
318; CHECK: attributes #28 = { inaccessiblememonly }
319; CHECK: attributes #29 = { inaccessiblemem_or_argmemonly }
320; CHECK: attributes #30 = { nobuiltin }
321