• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
4
5; CHECK: error: unsupported call to function external_function in test_call_external
6
7
8declare i32 @external_function(i32) nounwind
9
10define i32 @defined_function(i32 %x) nounwind noinline {
11  %y = add i32 %x, 8
12  ret i32 %y
13}
14
15define void @test_call(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
16  %b_ptr = getelementptr i32, i32 addrspace(1)* %in, i32 1
17  %a = load i32, i32 addrspace(1)* %in
18  %b = load i32, 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
22  ret void
23}
24
25define void @test_call_external(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 @external_function(i32 %b) nounwind
30  %result = add i32 %a, %c
31  store i32 %result, i32 addrspace(1)* %out
32  ret void
33}
34
35