1 ; RUN: not llc -march=amdgcn -mcpu=SI -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
5 ; CHECK: in function test_call_external{{.*}}: unsupported call to function external_function
8 declare i32 @external_function(i32) nounwind
10 define void @test_call_external(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
11 %b_ptr = getelementptr i32, i32 addrspace(1)* %in, i32 1
12 %a = load i32, i32 addrspace(1)* %in
13 %b = load i32, i32 addrspace(1)* %b_ptr
14 %c = call i32 @external_function(i32 %b) nounwind
15 %result = add i32 %a, %c
16 store i32 %result, i32 addrspace(1)* %out
20 define i32 @defined_function(i32 %x) nounwind noinline {
25 define void @test_call(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
26 %b_ptr = getelementptr i32, i32 addrspace(1)* %in, i32 1
27 %a = load i32, i32 addrspace(1)* %in
28 %b = load i32, i32 addrspace(1)* %b_ptr
29 %c = call i32 @defined_function(i32 %b) nounwind
30 %result = add i32 %a, %c
31 store i32 %result, i32 addrspace(1)* %out