2012-10-29 01:27:55 +01:00
|
|
|
; RUN: llvm-extract -func foo -S < %s | FileCheck %s
|
|
|
|
; RUN: llvm-extract -delete -func foo -S < %s | FileCheck --check-prefix=DELETE %s
|
2012-10-29 03:23:07 +01:00
|
|
|
; RUN: llvm-extract -alias zeda0 -S < %s | FileCheck --check-prefix=ALIAS %s
|
2013-10-29 00:37:45 +01:00
|
|
|
; RUN: llvm-extract -ralias '.*bar' -S < %s | FileCheck --check-prefix=ALIASRE %s
|
2012-10-29 01:27:55 +01:00
|
|
|
|
|
|
|
; Both aliases should be converted to declarations
|
|
|
|
; CHECK: @zeda0 = external global i32
|
|
|
|
; CHECK: define i32* @foo() {
|
|
|
|
; CHECK-NEXT: call void @a0bar()
|
|
|
|
; CHECK-NEXT: ret i32* @zeda0
|
|
|
|
; CHECK-NEXT: }
|
|
|
|
; CHECK: declare void @a0bar()
|
|
|
|
|
|
|
|
; DELETE: @zed = global i32 0
|
2015-09-11 05:22:04 +02:00
|
|
|
; DELETE: @zeda0 = alias i32, i32* @zed
|
|
|
|
; DELETE-NEXT: @a0foo = alias i32* (), i32* ()* @foo
|
|
|
|
; DELETE-NEXT: @a0a0bar = alias void (), void ()* @bar
|
|
|
|
; DELETE-NEXT: @a0bar = alias void (), void ()* @bar
|
2012-10-29 01:27:55 +01:00
|
|
|
; DELETE: declare i32* @foo()
|
|
|
|
; DELETE: define void @bar() {
|
|
|
|
; DELETE-NEXT: %c = call i32* @foo()
|
|
|
|
; DELETE-NEXT: ret void
|
|
|
|
; DELETE-NEXT: }
|
|
|
|
|
2012-10-29 03:23:07 +01:00
|
|
|
; ALIAS: @zed = external global i32
|
2015-09-11 05:22:04 +02:00
|
|
|
; ALIAS: @zeda0 = alias i32, i32* @zed
|
2012-10-29 03:23:07 +01:00
|
|
|
|
2015-09-11 05:22:04 +02:00
|
|
|
; ALIASRE: @a0a0bar = alias void (), void ()* @bar
|
|
|
|
; ALIASRE: @a0bar = alias void (), void ()* @bar
|
2012-10-29 03:23:07 +01:00
|
|
|
; ALIASRE: declare void @bar()
|
|
|
|
|
2012-10-29 01:27:55 +01:00
|
|
|
@zed = global i32 0
|
2015-09-11 05:22:04 +02:00
|
|
|
@zeda0 = alias i32, i32* @zed
|
2012-10-29 01:27:55 +01:00
|
|
|
|
2015-09-11 05:22:04 +02:00
|
|
|
@a0foo = alias i32* (), i32* ()* @foo
|
2012-10-29 01:27:55 +01:00
|
|
|
|
|
|
|
define i32* @foo() {
|
|
|
|
call void @a0bar()
|
|
|
|
ret i32* @zeda0
|
|
|
|
}
|
|
|
|
|
2015-09-11 05:22:04 +02:00
|
|
|
@a0a0bar = alias void (), void ()* @bar
|
2012-10-29 01:27:55 +01:00
|
|
|
|
2015-09-11 05:22:04 +02:00
|
|
|
@a0bar = alias void (), void ()* @bar
|
2012-10-29 01:27:55 +01:00
|
|
|
|
|
|
|
define void @bar() {
|
|
|
|
%c = call i32* @foo()
|
|
|
|
ret void
|
|
|
|
}
|