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 ptr @foo() {
9 ; CHECK-NEXT: call void @a0bar()
10 ; CHECK-NEXT: ret ptr @zeda0
12 ; CHECK: declare void @a0bar()
14 ; DELETE: @zed = global i32 0
15 ; DELETE: @zeda0 = alias i32, ptr @zed
16 ; DELETE-NEXT: @a0foo = alias ptr (), ptr @foo
17 ; DELETE-NEXT: @a0a0bar = alias void (), ptr @bar
18 ; DELETE-NEXT: @a0bar = alias void (), ptr @bar
19 ; DELETE: declare ptr @foo()
20 ; DELETE: define void @bar() {
21 ; DELETE-NEXT: %c = call ptr @foo()
22 ; DELETE-NEXT: ret void
25 ; ALIAS: @zed = external global i32
26 ; ALIAS: @zeda0 = alias i32, ptr @zed
28 ; ALIASRE: @a0a0bar = alias void (), ptr @bar
29 ; ALIASRE: @a0bar = alias void (), ptr @bar
30 ; ALIASRE: declare void @bar()
33 @zeda0 = alias i32, ptr @zed
35 @a0foo = alias ptr (), ptr @foo
42 @a0a0bar = alias void (), ptr @bar
44 @a0bar = alias void (), ptr @bar