• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: not llc -march=amdgcn -verify-machineinstrs < %s 2>&1 | FileCheck %s
2; RUN: not llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s 2>&1 | FileCheck %s
3; RUN: not llc -march=r600 -mcpu=cypress < %s 2>&1 | FileCheck %s
4
5; CHECK: in function test_call_external{{.*}}: unsupported call to function external_function
6; CHECK: in function test_call{{.*}}: unsupported call to function defined_function
7; CHECK: in function test_tail_call{{.*}}: unsupported call to function defined_function
8
9
10declare i32 @external_function(i32) nounwind
11
12define void @test_call_external(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
13  %b_ptr = getelementptr i32, i32 addrspace(1)* %in, i32 1
14  %a = load i32, i32 addrspace(1)* %in
15  %b = load i32, i32 addrspace(1)* %b_ptr
16  %c = call i32 @external_function(i32 %b) nounwind
17  %result = add i32 %a, %c
18  store i32 %result, i32 addrspace(1)* %out
19  ret void
20}
21
22define i32 @defined_function(i32 %x) nounwind noinline {
23  %y = add i32 %x, 8
24  ret i32 %y
25}
26
27define void @test_call(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
28  %b_ptr = getelementptr i32, i32 addrspace(1)* %in, i32 1
29  %a = load i32, i32 addrspace(1)* %in
30  %b = load i32, i32 addrspace(1)* %b_ptr
31  %c = call i32 @defined_function(i32 %b) nounwind
32  %result = add i32 %a, %c
33  store i32 %result, i32 addrspace(1)* %out
34  ret void
35}
36
37define void @test_tail_call(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
38  %b_ptr = getelementptr i32, i32 addrspace(1)* %in, i32 1
39  %a = load i32, i32 addrspace(1)* %in
40  %b = load i32, i32 addrspace(1)* %b_ptr
41  %c = tail call i32 @defined_function(i32 %b) nounwind
42  %result = add i32 %a, %c
43  store i32 %result, i32 addrspace(1)* %out
44  ret void
45}
46