brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · a744bf3 Raw
47 lines · plain
1; RUN: not llvm-as %s -disable-output 2>&1 | FileCheck %s2 3define amdgpu_cs void @indirect(ptr %fn, i32 %x) {4  ; CHECK: Indirect whole wave calls are not allowed5  %whatever = call i32(ptr, ...) @llvm.amdgcn.call.whole.wave(ptr %fn, i32 %x)6  ret void7}8 9declare amdgpu_gfx_whole_wave void @variadic_callee(i1 %active, i32 %x, ...)10 11define amdgpu_cs void @variadic(ptr %fn, i32 %x) {12  ; CHECK: Variadic whole wave calls are not allowed13  %whatever = call i32(ptr, ...) @llvm.amdgcn.call.whole.wave(ptr @variadic_callee, i32 %x)14  ret void15}16 17declare amdgpu_gfx void @bad_cc_callee(i1 %active, i32 %x)18 19define amdgpu_cs void @bad_cc(i32 %x) {20  ; CHECK: Callee must have the amdgpu_gfx_whole_wave calling convention21  %whatever = call i32(ptr, ...) @llvm.amdgcn.call.whole.wave(ptr @bad_cc_callee, i32 %x)22  ret void23}24 25declare amdgpu_gfx_whole_wave i32 @no_i1_callee(i32 %active, i32 %y, i32 %z)26 27define amdgpu_cs void @no_i1(i32 %x) {28  ; CHECK: Callee must have i1 as its first argument29  %whatever = call i32(ptr, ...) @llvm.amdgcn.call.whole.wave(ptr @no_i1_callee, i32 %x, i32 0)30  ret void31}32 33declare amdgpu_gfx_whole_wave i32 @good_callee(i1 %active, i32 %x, i32 inreg %y)34 35define amdgpu_cs void @bad_args(i32 %x) {36  ; CHECK: Call argument count must match callee argument count37  %whatever.0 = call i32(ptr, ...) @llvm.amdgcn.call.whole.wave(ptr @good_callee, i32 %x)38 39  ; CHECK: Argument types must match40  %whatever.1 = call i32(ptr, ...) @llvm.amdgcn.call.whole.wave(ptr @good_callee, i32 %x, i64 inreg 0)41 42  ; CHECK: Argument inreg attributes must match43  %whatever.2 = call i32(ptr, ...) @llvm.amdgcn.call.whole.wave(ptr @good_callee, i32 %x, i32 0)44 45  ret void46}47