Alexander Richardson | 47ff67b | 2018-08-23 09:25:17 +0000 | [diff] [blame] | 1 | ; Verify that forward declarations from call instructions work even with non-zero AS |
| 2 | ; RUN: llvm-as %s -o - | llvm-dis - | FileCheck %s |
| 3 | |
| 4 | define void @call_named() { |
| 5 | entry: |
| 6 | %0 = tail call addrspace(40) i32 @named(i16* null) |
| 7 | ; CHECK: %0 = tail call addrspace(40) i32 @named(i16* null) |
| 8 | ret void |
| 9 | } |
| 10 | |
| 11 | define void @call_numbered() { |
| 12 | entry: |
| 13 | %0 = tail call addrspace(40) i32 @0(i16* null) |
| 14 | ; CHECK: %0 = tail call addrspace(40) i32 @0(i16* null) |
| 15 | ret void |
| 16 | } |
| 17 | |
| 18 | |
| 19 | define i32 @invoked() personality i8* null { |
| 20 | entry: |
| 21 | %0 = invoke addrspace(40) i32 @foo() to label %l1 unwind label %lpad |
| 22 | ; CHECK: invoke addrspace(40) i32 @foo() |
| 23 | l1: |
| 24 | br label %return |
| 25 | lpad: |
| 26 | %1 = landingpad { i8*, i32 } |
| 27 | catch i8* null |
| 28 | catch i8* null |
| 29 | ret i32 0 |
| 30 | return: |
| 31 | ret i32 0 |
| 32 | } |
| 33 | |
| 34 | declare i32 @foo() addrspace(40) |
| 35 | ; CHECK: declare i32 @foo() addrspace(40) |
| 36 | declare i32 @named(i16* nocapture) addrspace(40) |
| 37 | ; CHECK: declare i32 @named(i16* nocapture) addrspace(40) |
| 38 | declare i32 @0(i16*) addrspace(40) |
| 39 | ; CHECK: declare i32 @0(i16*) addrspace(40) |