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: error: unsupported call to function external_function in test_call_external
8 declare i32 @external_function(i32) nounwind
10 define i32 @defined_function(i32 %x) nounwind noinline {
15 define void @test_call(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
16 %b_ptr = getelementptr i32 addrspace(1)* %in, i32 1
17 %a = load i32 addrspace(1)* %in
18 %b = load i32 addrspace(1)* %b_ptr
19 %c = call i32 @defined_function(i32 %b) nounwind
20 %result = add i32 %a, %c
21 store i32 %result, i32 addrspace(1)* %out
25 define void @test_call_external(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
26 %b_ptr = getelementptr i32 addrspace(1)* %in, i32 1
27 %a = load i32 addrspace(1)* %in
28 %b = load i32 addrspace(1)* %b_ptr
29 %c = call i32 @external_function(i32 %b) nounwind
30 %result = add i32 %a, %c
31 store i32 %result, i32 addrspace(1)* %out