1 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
2 ; RUN: verify-uselistorder < %s
5 define void @f1(i8 zeroext)
6 ; CHECK: define void @f1(i8 zeroext)
11 define void @f2(i8 signext)
12 ; CHECK: define void @f2(i8 signext)
17 define void @f3() noreturn
18 ; CHECK: define void @f3() #0
23 define void @f4(i8 inreg)
24 ; CHECK: define void @f4(i8 inreg)
29 define void @f5(i8* sret)
30 ; CHECK: define void @f5(i8* sret)
35 define void @f6() nounwind
36 ; CHECK: define void @f6() #1
41 define void @f7(i8* noalias)
42 ; CHECK: define void @f7(i8* noalias)
47 define void @f8(i8* byval)
48 ; CHECK: define void @f8(i8* byval(i8))
53 define void @f9(i8* nest)
54 ; CHECK: define void @f9(i8* nest)
59 define void @f10() readnone
60 ; CHECK: define void @f10() #2
65 define void @f11() readonly
66 ; CHECK: define void @f11() #3
71 define void @f12() noinline
72 ; CHECK: define void @f12() #4
77 define void @f13() alwaysinline
78 ; CHECK: define void @f13() #5
83 define void @f14() optsize
84 ; CHECK: define void @f14() #6
89 define void @f15() ssp
90 ; CHECK: define void @f15() #7
95 define void @f16() sspreq
96 ; CHECK: define void @f16() #8
101 define void @f17(i8 align 4)
102 ; CHECK: define void @f17(i8 align 4)
107 define void @f18(i8* nocapture)
108 ; CHECK: define void @f18(i8* nocapture)
113 define void @f19() noredzone
114 ; CHECK: define void @f19() #9
119 define void @f20() noimplicitfloat
120 ; CHECK: define void @f20() #10
125 define void @f21() naked
126 ; CHECK: define void @f21() #11
131 define void @f22() inlinehint
132 ; CHECK: define void @f22() #12
137 define void @f23() alignstack(4)
138 ; CHECK: define void @f23() #13
143 define void @f24() returns_twice
144 ; CHECK: define void @f24() #14
149 define void @f25() uwtable
150 ; CHECK: define void @f25() #15
155 define void @f26() nonlazybind
156 ; CHECK: define void @f26() #16
161 define void @f27() sanitize_address
162 ; CHECK: define void @f27() #17
166 define void @f28() sanitize_thread
167 ; CHECK: define void @f28() #18
171 define void @f29() sanitize_memory
172 ; CHECK: define void @f29() #19
177 define void @f30() "cpu"="cortex-a8"
178 ; CHECK: define void @f30() #20
183 define i8 @f31(i8 returned %A)
184 ; CHECK: define i8 @f31(i8 returned %A)
189 define void @f32() sspstrong
190 ; CHECK: define void @f32() #21
195 define void @f33() minsize
196 ; CHECK: define void @f33() #22
201 declare void @nobuiltin()
204 ; CHECK: define void @f34()
206 call void @nobuiltin() nobuiltin
207 ; CHECK: call void @nobuiltin() #39
211 define void @f35() optnone noinline
212 ; CHECK: define void @f35() #23
217 define void @f36(i8* inalloca) {
218 ; CHECK: define void @f36(i8* inalloca) {
222 define nonnull i8* @f37(i8* nonnull %a) {
223 ; CHECK: define nonnull i8* @f37(i8* nonnull %a) {
227 define void @f38() unnamed_addr jumptable {
228 ; CHECK: define void @f38() unnamed_addr #24
229 call void bitcast (void (i8*)* @f36 to void ()*)()
233 define dereferenceable(2) i8* @f39(i8* dereferenceable(1) %a) {
234 ; CHECK: define dereferenceable(2) i8* @f39(i8* dereferenceable(1) %a) {
238 define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(18446744073709551615) %a) {
239 ; CHECK: define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(18446744073709551615) %a) {
243 define void @f41(i8* align 32, double* align 64) {
244 ; CHECK: define void @f41(i8* align 32, double* align 64) {
248 ; CHECK: define dereferenceable_or_null(8) i8* @f42(i8* dereferenceable_or_null(8) %foo)
249 define dereferenceable_or_null(8) i8* @f42(i8* dereferenceable_or_null(8) %foo) {
254 ; CHECK: define void @f43() #25
255 define void @f43() convergent {
259 define void @f44() argmemonly
260 ; CHECK: define void @f44() #26
265 ; CHECK: define "string_attribute" void @f45(i32 "string_attribute")
266 define "string_attribute" void @f45(i32 "string_attribute") {
270 ; CHECK: define "string_attribute_with_value"="value" void @f46(i32 "string_attribute_with_value"="value")
271 define "string_attribute_with_value"="value" void @f46(i32 "string_attribute_with_value"="value") {
275 ; CHECK: define void @f47() #27
276 define void @f47() norecurse {
280 ; CHECK: define void @f48() #28
281 define void @f48() inaccessiblememonly {
285 ; CHECK: define void @f49() #29
286 define void @f49() inaccessiblemem_or_argmemonly {
290 ; CHECK: define void @f50(i8* swiftself)
291 define void @f50(i8* swiftself)
296 ; CHECK: define i32 @f51(i8** swifterror)
297 define i32 @f51(i8** swifterror)
302 ; CHECK: define i32 @f52(i32, i8** swifterror)
303 define i32 @f52(i32, i8** swifterror)
308 %swift_error = type {i64, i8}
309 declare float @foo(%swift_error** swifterror %error_ptr_ref)
311 ; CHECK: define float @f53
312 ; CHECK: alloca swifterror
313 define float @f53(i8* %error_ref) {
315 %error_ptr_ref = alloca swifterror %swift_error*
316 store %swift_error* null, %swift_error** %error_ptr_ref
317 %call = call float @foo(%swift_error** swifterror %error_ptr_ref)
321 ; CHECK: define i8* @f54(i32) #30
322 define i8* @f54(i32) allocsize(0) {
326 ; CHECK: define i8* @f55(i32, i32) #31
327 define i8* @f55(i32, i32) allocsize(0, 1) {
331 ; CHECK: define void @f56() #32
332 define void @f56() writeonly
337 ; CHECK: define void @f57() #33
338 define void @f57() speculatable {
342 ; CHECK: define void @f58() #34
343 define void @f58() sanitize_hwaddress
348 ; CHECK: define void @f59() #35
349 define void @f59() shadowcallstack
354 ; CHECK: define void @f60() #36
355 define void @f60() willreturn
360 ; CHECK: define void @f61() #37
361 define void @f61() nofree {
365 ; CHECK: define void @f62() #38
366 define void @f62() nosync
371 ; CHECK: attributes #0 = { noreturn }
372 ; CHECK: attributes #1 = { nounwind }
373 ; CHECK: attributes #2 = { readnone }
374 ; CHECK: attributes #3 = { readonly }
375 ; CHECK: attributes #4 = { noinline }
376 ; CHECK: attributes #5 = { alwaysinline }
377 ; CHECK: attributes #6 = { optsize }
378 ; CHECK: attributes #7 = { ssp }
379 ; CHECK: attributes #8 = { sspreq }
380 ; CHECK: attributes #9 = { noredzone }
381 ; CHECK: attributes #10 = { noimplicitfloat }
382 ; CHECK: attributes #11 = { naked }
383 ; CHECK: attributes #12 = { inlinehint }
384 ; CHECK: attributes #13 = { alignstack=4 }
385 ; CHECK: attributes #14 = { returns_twice }
386 ; CHECK: attributes #15 = { uwtable }
387 ; CHECK: attributes #16 = { nonlazybind }
388 ; CHECK: attributes #17 = { sanitize_address }
389 ; CHECK: attributes #18 = { sanitize_thread }
390 ; CHECK: attributes #19 = { sanitize_memory }
391 ; CHECK: attributes #20 = { "cpu"="cortex-a8" }
392 ; CHECK: attributes #21 = { sspstrong }
393 ; CHECK: attributes #22 = { minsize }
394 ; CHECK: attributes #23 = { noinline optnone }
395 ; CHECK: attributes #24 = { jumptable }
396 ; CHECK: attributes #25 = { convergent }
397 ; CHECK: attributes #26 = { argmemonly }
398 ; CHECK: attributes #27 = { norecurse }
399 ; CHECK: attributes #28 = { inaccessiblememonly }
400 ; CHECK: attributes #29 = { inaccessiblemem_or_argmemonly }
401 ; CHECK: attributes #30 = { allocsize(0) }
402 ; CHECK: attributes #31 = { allocsize(0,1) }
403 ; CHECK: attributes #32 = { writeonly }
404 ; CHECK: attributes #33 = { speculatable }
405 ; CHECK: attributes #34 = { sanitize_hwaddress }
406 ; CHECK: attributes #35 = { shadowcallstack }
407 ; CHECK: attributes #36 = { willreturn }
408 ; CHECK: attributes #37 = { nofree }
409 ; CHECK: attributes #38 = { nosync }
410 ; CHECK: attributes #39 = { nobuiltin }