|
1 |
| -; RUN: not --crash llc -mtriple=amdgcn -mcpu=tahiti -verify-machineinstrs -o /dev/null %s 2>&1 | FileCheck %s |
| 1 | +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s |
2 | 2 |
|
3 |
| -; FIXME: It should be invalid IR to have a call to a kernel, but this |
4 |
| -; is currently relied on, but should be eliminated before codegen. |
5 |
| -define amdgpu_kernel void @callee_kernel(ptr addrspace(1) %out) #0 { |
| 3 | +; CHECK: Call to amdgpu entry function is not allowed |
| 4 | +define amdgpu_kernel void @callee_kernel(ptr addrspace(1) %out) { |
6 | 5 | entry:
|
7 | 6 | store volatile i32 0, ptr addrspace(1) %out
|
8 | 7 | ret void
|
9 | 8 | }
|
10 | 9 |
|
11 |
| -; CHECK: LLVM ERROR: Unsupported calling convention for call |
12 |
| -define amdgpu_kernel void @caller_kernel(ptr addrspace(1) %out) #0 { |
| 10 | +define amdgpu_kernel void @caller_kernel(ptr addrspace(1) %out) { |
13 | 11 | entry:
|
14 |
| - call amdgpu_kernel void @callee_kernel(ptr addrspace(1) %out) |
| 12 | + call void @callee_kernel(ptr addrspace(1) %out) |
15 | 13 | ret void
|
16 | 14 | }
|
17 | 15 |
|
18 |
| -attributes #0 = { nounwind noinline } |
| 16 | +; CHECK: Call to amdgpu entry function is not allowed |
| 17 | +define amdgpu_vs void @callee_vs(ptr addrspace(1) inreg %out) { |
| 18 | +entry: |
| 19 | + store volatile i32 0, ptr addrspace(1) %out |
| 20 | + ret void |
| 21 | +} |
| 22 | + |
| 23 | +define amdgpu_vs void @caller_vs(ptr addrspace(1) inreg %out) { |
| 24 | +entry: |
| 25 | + call void @callee_vs(ptr addrspace(1) %out) |
| 26 | + ret void |
| 27 | +} |
| 28 | + |
| 29 | +; CHECK: Call to amdgpu entry function is not allowed |
| 30 | +define amdgpu_gs void @callee_gs(ptr addrspace(1) %out) { |
| 31 | +entry: |
| 32 | + store volatile i32 0, ptr addrspace(1) %out |
| 33 | + ret void |
| 34 | +} |
| 35 | + |
| 36 | +define amdgpu_gs void @caller_gs(ptr addrspace(1) %out) { |
| 37 | +entry: |
| 38 | + call void @callee_gs(ptr addrspace(1) %out) |
| 39 | + ret void |
| 40 | +} |
| 41 | + |
| 42 | +; CHECK: Call to amdgpu entry function is not allowed |
| 43 | +define amdgpu_ps void @callee_ps(ptr addrspace(1) %out) { |
| 44 | +entry: |
| 45 | + store volatile i32 0, ptr addrspace(1) %out |
| 46 | + ret void |
| 47 | +} |
| 48 | + |
| 49 | +define amdgpu_ps void @caller_ps(ptr addrspace(1) %out) { |
| 50 | +entry: |
| 51 | + call void @callee_ps(ptr addrspace(1) %out) |
| 52 | + ret void |
| 53 | +} |
| 54 | + |
| 55 | +; CHECK: Call to amdgpu entry function is not allowed |
| 56 | +define amdgpu_cs void @callee_cs(ptr addrspace(1) %out) { |
| 57 | +entry: |
| 58 | + store volatile i32 0, ptr addrspace(1) %out |
| 59 | + ret void |
| 60 | +} |
| 61 | + |
| 62 | +define amdgpu_cs void @caller_cs(ptr addrspace(1) %out) { |
| 63 | +entry: |
| 64 | + call void @callee_cs(ptr addrspace(1) %out) |
| 65 | + ret void |
| 66 | +} |
| 67 | + |
| 68 | +; CHECK: Call to amdgpu entry function is not allowed |
| 69 | +define amdgpu_es void @callee_es(ptr addrspace(1) %out) { |
| 70 | +entry: |
| 71 | + store volatile i32 0, ptr addrspace(1) %out |
| 72 | + ret void |
| 73 | +} |
| 74 | + |
| 75 | +define amdgpu_es void @caller_es(ptr addrspace(1) %out) { |
| 76 | +entry: |
| 77 | + call void @callee_es(ptr addrspace(1) %out) |
| 78 | + ret void |
| 79 | +} |
| 80 | + |
| 81 | +; CHECK: Call to amdgpu entry function is not allowed |
| 82 | +define amdgpu_hs void @callee_hs(ptr addrspace(1) %out) { |
| 83 | +entry: |
| 84 | + store volatile i32 0, ptr addrspace(1) %out |
| 85 | + ret void |
| 86 | +} |
| 87 | + |
| 88 | +define amdgpu_hs void @caller_hs(ptr addrspace(1) %out) { |
| 89 | +entry: |
| 90 | + call void @callee_hs(ptr addrspace(1) %out) |
| 91 | + ret void |
| 92 | +} |
| 93 | + |
| 94 | +; CHECK: Call to amdgpu entry function is not allowed |
| 95 | +define amdgpu_ls void @callee_ls(ptr addrspace(1) %out) { |
| 96 | +entry: |
| 97 | + store volatile i32 0, ptr addrspace(1) %out |
| 98 | + ret void |
| 99 | +} |
| 100 | + |
| 101 | +define amdgpu_ls void @caller_ls(ptr addrspace(1) %out) { |
| 102 | +entry: |
| 103 | + call void @callee_ls(ptr addrspace(1) %out) |
| 104 | + ret void |
| 105 | +} |
0 commit comments