blob: 82e77350ab2d73a779dadb688345354ce85f26b0 [file] [log] [blame]
Tom Stellard49f8bfd2015-01-06 18:00:21 +00001; RUN: not llc -march=amdgcn -mcpu=SI -verify-machineinstrs< %s 2>&1 | FileCheck %s
Marek Olsak75170772015-01-27 17:27:15 +00002; RUN: not llc -march=amdgcn -mcpu=tonga -verify-machineinstrs< %s 2>&1 | FileCheck %s
Matt Arsenault16353872014-04-22 16:42:00 +00003; RUN: not llc -march=r600 -mcpu=cypress < %s 2>&1 | FileCheck %s
4
Oliver Stannard7e7d9832016-02-02 13:52:43 +00005; CHECK: in function test_call_external{{.*}}: unsupported call to function external_function
Matt Arsenault16353872014-04-22 16:42:00 +00006
7
8declare i32 @external_function(i32) nounwind
9
Matt Arsenaultdeaef8e2015-04-22 17:10:44 +000010define 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
17 ret void
18}
19
Matt Arsenault16353872014-04-22 16:42:00 +000020define i32 @defined_function(i32 %x) nounwind noinline {
21 %y = add i32 %x, 8
22 ret i32 %y
23}
24
25define void @test_call(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
David Blaikie79e6c742015-02-27 19:29:02 +000026 %b_ptr = getelementptr i32, i32 addrspace(1)* %in, i32 1
David Blaikiea79ac142015-02-27 21:17:42 +000027 %a = load i32, i32 addrspace(1)* %in
28 %b = load i32, i32 addrspace(1)* %b_ptr
Matt Arsenault16353872014-04-22 16:42:00 +000029 %c = call i32 @defined_function(i32 %b) nounwind
30 %result = add i32 %a, %c
31 store i32 %result, i32 addrspace(1)* %out
32 ret void
33}