brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 721114e Raw
59 lines · plain
1; RUN: not llc -mtriple=amdgcn-mesa-mesa3d -tailcallopt < %s 2>&1 | FileCheck --check-prefix=GCN %s2; RUN: not llc -mtriple=amdgcn--amdpal -tailcallopt < %s 2>&1 | FileCheck --check-prefix=GCN %s3; RUN: not llc -mtriple=r600-- -mcpu=cypress -tailcallopt < %s 2>&1 | FileCheck -check-prefix=R600 %s4 5declare i32 @external_function(i32) nounwind6 7; GCN-NOT: error8; R600: in function test_call_external{{.*}}: unsupported call to function external_function9define amdgpu_kernel void @test_call_external(ptr addrspace(1) %out, ptr addrspace(1) %in) {10  %b_ptr = getelementptr i32, ptr addrspace(1) %in, i32 111  %a = load i32, ptr addrspace(1) %in12  %b = load i32, ptr addrspace(1) %b_ptr13  %c = call i32 @external_function(i32 %b) nounwind14  %result = add i32 %a, %c15  store i32 %result, ptr addrspace(1) %out16  ret void17}18 19define i32 @defined_function(i32 %x) nounwind noinline {20  %y = add i32 %x, 821  ret i32 %y22}23 24; GCN-NOT: error25; R600: in function test_call{{.*}}: unsupported call to function defined_function26define amdgpu_kernel void @test_call(ptr addrspace(1) %out, ptr addrspace(1) %in) {27  %b_ptr = getelementptr i32, ptr addrspace(1) %in, i32 128  %a = load i32, ptr addrspace(1) %in29  %b = load i32, ptr addrspace(1) %b_ptr30  %c = call i32 @defined_function(i32 %b) nounwind31  %result = add i32 %a, %c32  store i32 %result, ptr addrspace(1) %out33  ret void34}35 36; GCN: error: <unknown>:0:0: in function test_tail_call i32 (ptr addrspace(1), ptr addrspace(1)): unsupported required tail call to function defined_function37; R600: in function test_tail_call{{.*}}: unsupported call to function defined_function38define i32 @test_tail_call(ptr addrspace(1) %out, ptr addrspace(1) %in) {39  %b_ptr = getelementptr i32, ptr addrspace(1) %in, i32 140  %a = load i32, ptr addrspace(1) %in41  %b = load i32, ptr addrspace(1) %b_ptr42  %c = tail call i32 @defined_function(i32 %b)43  ret i32 %c44}45 46; R600: in function test_c_call{{.*}}: unsupported call to function defined_function47define amdgpu_ps i32 @test_c_call_from_shader() {48  %call = call i32 @defined_function(i32 0)49  ret i32 %call50}51 52; GCN-NOT: in function test_gfx_call{{.*}}unsupported53; R600: in function test_gfx_call{{.*}}: unsupported call to function defined_function54define amdgpu_ps i32 @test_gfx_call_from_shader() {55  %call = call amdgpu_gfx i32 @defined_function(i32 0)56  ret i32 %call57}58 59