1 ; RUN: llvm-extract -func foo -S < %s | FileCheck %s
2 ; RUN: llvm-extract -delete -func foo -S < %s | FileCheck --check-prefix=DELETE %s
3 ; RUN: llvm-extract -alias zeda0 -S < %s | FileCheck --check-prefix=ALIAS %s
4 ; RUN: llvm-extract -ralias '.*bar' -S < %s | FileCheck --check-prefix=ALIASRE %s
6 ; Both aliases should be converted to declarations
7 ; CHECK: @zeda0 = external global i32
8 ; CHECK: define i32* @foo() {
9 ; CHECK-NEXT: call void @a0bar()
10 ; CHECK-NEXT: ret i32* @zeda0
12 ; CHECK: declare void @a0bar()
14 ; DELETE: @zed = global i32 0
15 ; DELETE: @zeda0 = alias i32, i32* @zed
16 ; DELETE-NEXT: @a0foo = alias i32* (), i32* ()* @foo
17 ; DELETE-NEXT: @a0a0bar = alias void (), void ()* @bar
18 ; DELETE-NEXT: @a0bar = alias void (), void ()* @bar
19 ; DELETE: declare i32* @foo()
20 ; DELETE: define void @bar() {
21 ; DELETE-NEXT: %c = call i32* @foo()
22 ; DELETE-NEXT: ret void
25 ; ALIAS: @zed = external global i32
26 ; ALIAS: @zeda0 = alias i32, i32* @zed
28 ; ALIASRE: @a0a0bar = alias void (), void ()* @bar
29 ; ALIASRE: @a0bar = alias void (), void ()* @bar
30 ; ALIASRE: declare void @bar()
33 @zeda0 = alias i32, i32* @zed
35 @a0foo = alias i32* (), i32* ()* @foo
42 @a0a0bar = alias void (), void ()* @bar
44 @a0bar = alias void (), void ()* @bar