Home | History | Annotate | Download | only in Bitcode
      1 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
      2 ; RUN: verify-uselistorder < %s
      3 ; PR12696
      4 
      5 define void @f1(i8 zeroext)
      6 ; CHECK: define void @f1(i8 zeroext)
      7 {
      8         ret void;
      9 }
     10 
     11 define void @f2(i8 signext)
     12 ; CHECK: define void @f2(i8 signext)
     13 {
     14         ret void;
     15 }
     16 
     17 define void @f3() noreturn
     18 ; CHECK: define void @f3() #0
     19 {
     20         ret void;
     21 }
     22 
     23 define void @f4(i8 inreg)
     24 ; CHECK: define void @f4(i8 inreg)
     25 {
     26         ret void;
     27 }
     28 
     29 define void @f5(i8* sret)
     30 ; CHECK: define void @f5(i8* sret)
     31 {
     32         ret void;
     33 }
     34 
     35 define void @f6() nounwind
     36 ; CHECK: define void @f6() #1
     37 {
     38         ret void;
     39 }
     40 
     41 define void @f7(i8* noalias)
     42 ; CHECK: define void @f7(i8* noalias)
     43 {
     44         ret void;
     45 }
     46 
     47 define void @f8(i8* byval)
     48 ; CHECK: define void @f8(i8* byval)
     49 {
     50         ret void;
     51 }
     52 
     53 define void @f9(i8* nest)
     54 ; CHECK: define void @f9(i8* nest)
     55 {
     56         ret void;
     57 }
     58 
     59 define void @f10() readnone
     60 ; CHECK: define void @f10() #2
     61 {
     62         ret void;
     63 }
     64 
     65 define void @f11() readonly
     66 ; CHECK: define void @f11() #3
     67 {
     68         ret void;
     69 }
     70 
     71 define void @f12() noinline
     72 ; CHECK: define void @f12() #4
     73 {
     74         ret void;
     75 }
     76 
     77 define void @f13() alwaysinline
     78 ; CHECK: define void @f13() #5
     79 {
     80         ret void;
     81 }
     82 
     83 define void @f14() optsize
     84 ; CHECK: define void @f14() #6
     85 {
     86         ret void;
     87 }
     88 
     89 define void @f15() ssp
     90 ; CHECK: define void @f15() #7
     91 {
     92         ret void;
     93 }
     94 
     95 define void @f16() sspreq
     96 ; CHECK: define void @f16() #8
     97 {
     98         ret void;
     99 }
    100 
    101 define void @f17(i8 align 4)
    102 ; CHECK: define void @f17(i8 align 4)
    103 {
    104         ret void;
    105 }
    106 
    107 define void @f18(i8* nocapture)
    108 ; CHECK: define void @f18(i8* nocapture)
    109 {
    110         ret void;
    111 }
    112 
    113 define void @f19() noredzone
    114 ; CHECK: define void @f19() #9
    115 {
    116         ret void;
    117 }
    118 
    119 define void @f20() noimplicitfloat
    120 ; CHECK: define void @f20() #10
    121 {
    122         ret void;
    123 }
    124 
    125 define void @f21() naked
    126 ; CHECK: define void @f21() #11
    127 {
    128         ret void;
    129 }
    130 
    131 define void @f22() inlinehint
    132 ; CHECK: define void @f22() #12
    133 {
    134         ret void;
    135 }
    136 
    137 define void @f23() alignstack(4)
    138 ; CHECK: define void @f23() #13
    139 {
    140         ret void;
    141 }
    142 
    143 define void @f24() returns_twice
    144 ; CHECK: define void @f24() #14
    145 {
    146         ret void;
    147 }
    148 
    149 define void @f25() uwtable
    150 ; CHECK: define void @f25() #15
    151 {
    152         ret void;
    153 }
    154 
    155 define void @f26() nonlazybind
    156 ; CHECK: define void @f26() #16
    157 {
    158         ret void;
    159 }
    160 
    161 define void @f27() sanitize_address
    162 ; CHECK: define void @f27() #17
    163 {
    164         ret void;
    165 }
    166 define void @f28() sanitize_thread
    167 ; CHECK: define void @f28() #18
    168 {
    169         ret void;
    170 }
    171 define void @f29() sanitize_memory
    172 ; CHECK: define void @f29() #19
    173 {
    174         ret void;
    175 }
    176 
    177 define void @f30() "cpu"="cortex-a8"
    178 ; CHECK: define void @f30() #20
    179 {
    180         ret void;
    181 }
    182 
    183 define i8 @f31(i8 returned %A)
    184 ; CHECK: define i8 @f31(i8 returned %A)
    185 {
    186         ret i8 %A;
    187 }
    188 
    189 define void @f32() sspstrong
    190 ; CHECK: define void @f32() #21
    191 {
    192         ret void;
    193 }
    194 
    195 define void @f33() minsize
    196 ; CHECK: define void @f33() #22
    197 {
    198         ret void;
    199 }
    200 
    201 declare void @nobuiltin()
    202 
    203 define void @f34()
    204 ; CHECK: define void @f34()
    205 {
    206         call void @nobuiltin() nobuiltin
    207 ; CHECK: call void @nobuiltin() #33
    208         ret void;
    209 }
    210 
    211 define void @f35() optnone noinline
    212 ; CHECK: define void @f35() #23
    213 {
    214         ret void;
    215 }
    216 
    217 define void @f36(i8* inalloca) {
    218 ; CHECK: define void @f36(i8* inalloca) {
    219         ret void
    220 }
    221 
    222 define nonnull i8* @f37(i8* nonnull %a) {
    223 ; CHECK: define nonnull i8* @f37(i8* nonnull %a) {
    224         ret i8* %a
    225 }
    226 
    227 define 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 
    233 define 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 
    238 define 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 
    243 define 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)
    249 define 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
    255 define void @f43() convergent {
    256   ret void
    257 }
    258 
    259 define 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")
    266 define "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")
    271 define "string_attribute_with_value"="value" void @f46(i32 "string_attribute_with_value"="value") {
    272   ret void
    273 }
    274 
    275 ; CHECK: define void @f47() #27
    276 define void @f47() norecurse {
    277   ret void
    278 }
    279 
    280 ; CHECK: define void @f48() #28
    281 define void @f48() inaccessiblememonly {
    282   ret void
    283 }
    284 
    285 ; CHECK: define void @f49() #29
    286 define void @f49() inaccessiblemem_or_argmemonly {
    287   ret void
    288 }
    289 
    290 ; CHECK: define void @f50(i8* swiftself)
    291 define void @f50(i8* swiftself)
    292 {
    293   ret void;
    294 }
    295 
    296 ; CHECK: define i32 @f51(i8** swifterror)
    297 define i32 @f51(i8** swifterror)
    298 {
    299   ret i32 0
    300 }
    301 
    302 ; CHECK: define i32 @f52(i32, i8** swifterror)
    303 define i32 @f52(i32, i8** swifterror)
    304 {
    305   ret i32 0
    306 }
    307 
    308 %swift_error = type {i64, i8}
    309 declare float @foo(%swift_error** swifterror %error_ptr_ref)
    310 
    311 ; CHECK: define float @f53
    312 ; CHECK: alloca swifterror
    313 define float @f53(i8* %error_ref) {
    314 entry:
    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)
    318   ret float 1.0
    319 }
    320 
    321 ; CHECK: define i8* @f54(i32) #30
    322 define i8* @f54(i32) allocsize(0) {
    323   ret i8* null
    324 }
    325 
    326 ; CHECK: define i8* @f55(i32, i32) #31
    327 define i8* @f55(i32, i32) allocsize(0, 1) {
    328   ret i8* null
    329 }
    330 
    331 ; CHECK: define void @f56() #32
    332 define void @f56() writeonly
    333 {
    334   ret void
    335 }
    336 
    337 ; CHECK: attributes #0 = { noreturn }
    338 ; CHECK: attributes #1 = { nounwind }
    339 ; CHECK: attributes #2 = { readnone }
    340 ; CHECK: attributes #3 = { readonly }
    341 ; CHECK: attributes #4 = { noinline }
    342 ; CHECK: attributes #5 = { alwaysinline }
    343 ; CHECK: attributes #6 = { optsize }
    344 ; CHECK: attributes #7 = { ssp }
    345 ; CHECK: attributes #8 = { sspreq }
    346 ; CHECK: attributes #9 = { noredzone }
    347 ; CHECK: attributes #10 = { noimplicitfloat }
    348 ; CHECK: attributes #11 = { naked }
    349 ; CHECK: attributes #12 = { inlinehint }
    350 ; CHECK: attributes #13 = { alignstack=4 }
    351 ; CHECK: attributes #14 = { returns_twice }
    352 ; CHECK: attributes #15 = { uwtable }
    353 ; CHECK: attributes #16 = { nonlazybind }
    354 ; CHECK: attributes #17 = { sanitize_address }
    355 ; CHECK: attributes #18 = { sanitize_thread }
    356 ; CHECK: attributes #19 = { sanitize_memory }
    357 ; CHECK: attributes #20 = { "cpu"="cortex-a8" }
    358 ; CHECK: attributes #21 = { sspstrong }
    359 ; CHECK: attributes #22 = { minsize }
    360 ; CHECK: attributes #23 = { noinline optnone }
    361 ; CHECK: attributes #24 = { jumptable }
    362 ; CHECK: attributes #25 = { convergent }
    363 ; CHECK: attributes #26 = { argmemonly }
    364 ; CHECK: attributes #27 = { norecurse }
    365 ; CHECK: attributes #28 = { inaccessiblememonly }
    366 ; CHECK: attributes #29 = { inaccessiblemem_or_argmemonly }
    367 ; CHECK: attributes #30 = { allocsize(0) }
    368 ; CHECK: attributes #31 = { allocsize(0,1) }
    369 ; CHECK: attributes #32 = { writeonly }
    370 ; CHECK: attributes #33 = { nobuiltin }
    371