Renato Golin | 4b9c0d4 | 2016-05-16 14:28:02 +0000 | [diff] [blame^] | 1 | ; RUN: not llc -march=amdgcn -mcpu=SI -verify-machineinstrs -exit-on-error < %s 2>&1 | FileCheck %s |
| 2 | ; RUN: not llc -march=amdgcn -mcpu=tonga -verify-machineinstrs -exit-on-error < %s 2>&1 | FileCheck %s |
| 3 | ; RUN: not llc -march=r600 -mcpu=cypress -exit-on-error < %s 2>&1 | FileCheck %s |
Matt Arsenault | 1635387 | 2014-04-22 16:42:00 +0000 | [diff] [blame] | 4 | |
Oliver Stannard | 7e7d983 | 2016-02-02 13:52:43 +0000 | [diff] [blame] | 5 | ; CHECK: in function test_call_external{{.*}}: unsupported call to function external_function |
Matt Arsenault | 1635387 | 2014-04-22 16:42:00 +0000 | [diff] [blame] | 6 | |
| 7 | |
| 8 | declare i32 @external_function(i32) nounwind |
| 9 | |
Matt Arsenault | deaef8e | 2015-04-22 17:10:44 +0000 | [diff] [blame] | 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 |
| 17 | ret void |
| 18 | } |
| 19 | |
Matt Arsenault | 1635387 | 2014-04-22 16:42:00 +0000 | [diff] [blame] | 20 | define i32 @defined_function(i32 %x) nounwind noinline { |
| 21 | %y = add i32 %x, 8 |
| 22 | ret i32 %y |
| 23 | } |
| 24 | |
| 25 | define void @test_call(i32 addrspace(1)* %out, i32 addrspace(1)* %in) { |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 26 | %b_ptr = getelementptr i32, i32 addrspace(1)* %in, i32 1 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 27 | %a = load i32, i32 addrspace(1)* %in |
| 28 | %b = load i32, i32 addrspace(1)* %b_ptr |
Matt Arsenault | 1635387 | 2014-04-22 16:42:00 +0000 | [diff] [blame] | 29 | %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 | } |