1 ; RUN: not llvm-as < %s 2>&1 | FileCheck %s
3 target datalayout = "A5"
5 ; CHECK: Calling convention requires void return type
6 ; CHECK-NEXT: i32 ()* @nonvoid_cc_amdgpu_kernel
7 define amdgpu_kernel i32 @nonvoid_cc_amdgpu_kernel() {
11 ; CHECK: Calling convention does not support varargs or perfect forwarding!
12 ; CHECK-NEXT: void (...)* @varargs_amdgpu_kernel
13 define amdgpu_kernel void @varargs_amdgpu_kernel(...) {
17 ; CHECK: Calling convention does not allow sret
18 ; CHECK-NEXT: void (i32*)* @sret_cc_amdgpu_kernel_as0
19 define amdgpu_kernel void @sret_cc_amdgpu_kernel_as0(i32* sret(i32) %ptr) {
23 ; CHECK: Calling convention does not allow sret
24 ; CHECK-NEXT: void (i32 addrspace(5)*)* @sret_cc_amdgpu_kernel
25 define amdgpu_kernel void @sret_cc_amdgpu_kernel(i32 addrspace(5)* sret(i32) %ptr) {
29 ; CHECK: Calling convention does not support varargs or perfect forwarding!
30 ; CHECK-NEXT: void (...)* @varargs_amdgpu_vs
31 define amdgpu_vs void @varargs_amdgpu_vs(...) {
35 ; CHECK: Calling convention does not support varargs or perfect forwarding!
36 ; CHECK-NEXT: void (...)* @varargs_amdgpu_gs
37 define amdgpu_gs void @varargs_amdgpu_gs(...) {
41 ; CHECK: Calling convention does not support varargs or perfect forwarding!
42 ; CHECK-NEXT: void (...)* @varargs_amdgpu_ps
43 define amdgpu_ps void @varargs_amdgpu_ps(...) {
47 ; CHECK: Calling convention does not support varargs or perfect forwarding!
48 ; CHECK-NEXT: void (...)* @varargs_amdgpu_cs
49 define amdgpu_cs void @varargs_amdgpu_cs(...) {
53 ; CHECK: Calling convention requires void return type
54 ; CHECK-NEXT: i32 ()* @nonvoid_cc_spir_kernel
55 define spir_kernel i32 @nonvoid_cc_spir_kernel() {
59 ; CHECK: Calling convention does not support varargs or perfect forwarding!
60 ; CHECK-NEXT: void (...)* @varargs_spir_kernel
61 define spir_kernel void @varargs_spir_kernel(...) {
65 ; CHECK: Calling convention disallows byval
66 ; CHECK-NEXT: void (i32 addrspace(5)*)* @byval_cc_amdgpu_kernel
67 define amdgpu_kernel void @byval_cc_amdgpu_kernel(i32 addrspace(5)* byval(i32) %ptr) {
71 ; CHECK: Calling convention disallows byval
72 ; CHECK-NEXT: void (i32 addrspace(1)*)* @byval_as1_cc_amdgpu_kernel
73 define amdgpu_kernel void @byval_as1_cc_amdgpu_kernel(i32 addrspace(1)* byval(i32) %ptr) {
77 ; CHECK: Calling convention disallows byval
78 ; CHECK-NEXT: void (i32*)* @byval_as0_cc_amdgpu_kernel
79 define amdgpu_kernel void @byval_as0_cc_amdgpu_kernel(i32* byval(i32) %ptr) {
83 ; CHECK: Calling convention disallows byval
84 ; CHECK-NEXT: void (i32 addrspace(5)*)* @byval_cc_amdgpu_vs
85 define amdgpu_vs void @byval_cc_amdgpu_vs(i32 addrspace(5)* byval(i32) %ptr) {
89 ; CHECK: Calling convention disallows byval
90 ; CHECK-NEXT: void (i32 addrspace(5)*)* @byval_cc_amdgpu_hs
91 define amdgpu_hs void @byval_cc_amdgpu_hs(i32 addrspace(5)* byval(i32) %ptr) {
95 ; CHECK: Calling convention disallows byval
96 ; CHECK-NEXT: void (i32 addrspace(5)*)* @byval_cc_amdgpu_gs
97 define amdgpu_gs void @byval_cc_amdgpu_gs(i32 addrspace(5)* byval(i32) %ptr) {
101 ; CHECK: Calling convention disallows byval
102 ; CHECK-NEXT: void (i32 addrspace(5)*)* @byval_cc_amdgpu_ps
103 define amdgpu_ps void @byval_cc_amdgpu_ps(i32 addrspace(5)* byval(i32) %ptr) {
107 ; CHECK: Calling convention disallows byval
108 ; CHECK-NEXT: void (i32 addrspace(5)*)* @byval_cc_amdgpu_cs
109 define amdgpu_cs void @byval_cc_amdgpu_cs(i32 addrspace(5)* byval(i32) %ptr) {
113 ; CHECK: Calling convention disallows preallocated
114 ; CHECK-NEXT: void (i32*)* @preallocated_as0_cc_amdgpu_kernel
115 define amdgpu_kernel void @preallocated_as0_cc_amdgpu_kernel(i32* preallocated(i32) %ptr) {
119 ; CHECK: Calling convention disallows inalloca
120 ; CHECK-NEXT: void (i32*)* @inalloca_as0_cc_amdgpu_kernel
121 define amdgpu_kernel void @inalloca_as0_cc_amdgpu_kernel(i32* inalloca(i32) %ptr) {
125 ; CHECK: Calling convention disallows stack byref
126 ; CHECK-NEXT: void (i32 addrspace(5)*)* @byref_as5_cc_amdgpu_kernel
127 define amdgpu_kernel void @byref_as5_cc_amdgpu_kernel(i32 addrspace(5)* byref(i32) %ptr) {