88 lines · plain
1; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s2 3%opaque.ty = type opaque4 5; CHECK: Attribute 'byref' does not support unsized types!6; CHECK-NEXT: ptr @byref_unsized7define void @byref_unsized(ptr byref(%opaque.ty)) {8 ret void9}10 11; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!12; CHECK-NEXT: ptr @byref_byval13define void @byref_byval(ptr byref(i32) byval(i32)) {14 ret void15}16 17; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!18; CHECK-NEXT: ptr @byref_inalloca19define void @byref_inalloca(ptr byref(i32) inalloca(i32)) {20 ret void21}22 23; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!24; CHECK-NEXT: ptr @byref_preallocated25define void @byref_preallocated(ptr byref(i32) preallocated(i32)) {26 ret void27}28 29; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!30; CHECK-NEXT: ptr @byref_sret31define void @byref_sret(ptr byref(i32) sret(i32)) {32 ret void33}34 35; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!36; CHECK-NEXT: ptr @byref_inreg37define void @byref_inreg(ptr byref(i32) inreg) {38 ret void39}40 41; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!42; CHECK-NEXT: ptr @byref_nest43define void @byref_nest(ptr byref(i32) nest) {44 ret void45}46 47; CHECK: Attribute 'byref(i32)' applied to incompatible type!48; CHECK-NEXT: ptr @byref_non_pointer49define void @byref_non_pointer(i32 byref(i32)) {50 ret void51}52 53define void @byref_callee(ptr byref([64 x i8])) {54 ret void55}56 57define void @no_byref_callee(ptr) {58 ret void59}60 61; CHECK: cannot guarantee tail call due to mismatched ABI impacting function attributes62; CHECK-NEXT: musttail call void @byref_callee(ptr byref([64 x i8]) %ptr)63; CHECK-NEXT: ptr %ptr64define void @musttail_byref_caller(ptr %ptr) {65 musttail call void @byref_callee(ptr byref([64 x i8]) %ptr)66 ret void67}68 69; CHECK: cannot guarantee tail call due to mismatched ABI impacting function attributes70; CHECK-NEXT: musttail call void @byref_callee(ptr %ptr)71; CHECK-NEXT: ptr %ptr72define void @musttail_byref_callee(ptr byref([64 x i8]) %ptr) {73 musttail call void @byref_callee(ptr %ptr)74 ret void75}76 77define void @byref_callee_align32(ptr byref([64 x i8]) align 32) {78 ret void79}80 81; CHECK: cannot guarantee tail call due to mismatched ABI impacting function attributes82; CHECK-NEXT: musttail call void @byref_callee_align32(ptr byref([64 x i8]) align 32 %ptr)83; CHECK-NEXT: ptr %ptr84define void @musttail_byref_caller_mismatched_align(ptr byref([64 x i8]) align 16 %ptr) {85 musttail call void @byref_callee_align32(ptr byref([64 x i8]) align 32 %ptr)86 ret void87}88