1 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
3 %opaque.ty = type opaque
5 ; CHECK: Attribute 'byref' does not support unsized types!
6 ; CHECK-NEXT: ptr @byref_unsized
7 define void @byref_unsized(ptr byref(%opaque.ty)) {
11 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
12 ; CHECK-NEXT: ptr @byref_byval
13 define void @byref_byval(ptr byref(i32) byval(i32)) {
17 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
18 ; CHECK-NEXT: ptr @byref_inalloca
19 define void @byref_inalloca(ptr byref(i32) inalloca(i32)) {
23 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
24 ; CHECK-NEXT: ptr @byref_preallocated
25 define void @byref_preallocated(ptr byref(i32) preallocated(i32)) {
29 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
30 ; CHECK-NEXT: ptr @byref_sret
31 define void @byref_sret(ptr byref(i32) sret(i32)) {
35 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
36 ; CHECK-NEXT: ptr @byref_inreg
37 define void @byref_inreg(ptr byref(i32) inreg) {
41 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
42 ; CHECK-NEXT: ptr @byref_nest
43 define void @byref_nest(ptr byref(i32) nest) {
47 ; CHECK: Attribute 'byref(i32)' applied to incompatible type!
48 ; CHECK-NEXT: ptr @byref_non_pointer
49 define void @byref_non_pointer(i32 byref(i32)) {
53 define void @byref_callee(ptr byref([64 x i8])) {
57 define void @no_byref_callee(ptr) {
61 ; CHECK: cannot guarantee tail call due to mismatched ABI impacting function attributes
62 ; CHECK-NEXT: musttail call void @byref_callee(ptr byref([64 x i8]) %ptr)
63 ; CHECK-NEXT: ptr %ptr
64 define void @musttail_byref_caller(ptr %ptr) {
65 musttail call void @byref_callee(ptr byref([64 x i8]) %ptr)
69 ; CHECK: cannot guarantee tail call due to mismatched ABI impacting function attributes
70 ; CHECK-NEXT: musttail call void @byref_callee(ptr %ptr)
71 ; CHECK-NEXT: ptr %ptr
72 define void @musttail_byref_callee(ptr byref([64 x i8]) %ptr) {
73 musttail call void @byref_callee(ptr %ptr)
77 define void @byref_callee_align32(ptr byref([64 x i8]) align 32) {
81 ; CHECK: cannot guarantee tail call due to mismatched ABI impacting function attributes
82 ; CHECK-NEXT: musttail call void @byref_callee_align32(ptr byref([64 x i8]) align 32 %ptr)
83 ; CHECK-NEXT: ptr %ptr
84 define 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)