2013-03-04 23:40:44 +01:00
|
|
|
; RUN: llvm-extract -func foo -S < %s | FileCheck %s
|
|
|
|
; RUN: llvm-extract -delete -func foo -S < %s | FileCheck --check-prefix=DELETE %s
|
|
|
|
|
2013-11-22 18:58:12 +01:00
|
|
|
; Test that linkonce definitions are mapped to weak so that they are not
|
|
|
|
; dropped.
|
2013-03-04 23:40:44 +01:00
|
|
|
|
2013-11-22 18:58:12 +01:00
|
|
|
; CHECK: @bar = external global i32
|
|
|
|
; CHECK: define weak i32* @foo() {
|
2013-03-04 23:40:44 +01:00
|
|
|
; CHECK-NEXT: ret i32* @bar
|
|
|
|
; CHECK-NEXT: }
|
|
|
|
|
2013-11-22 18:58:12 +01:00
|
|
|
; DELETE: @bar = weak global i32 42
|
|
|
|
; DELETE: declare i32* @foo()
|
2013-03-04 23:40:44 +01:00
|
|
|
|
|
|
|
@bar = linkonce global i32 42
|
|
|
|
|
|
|
|
define linkonce i32* @foo() {
|
|
|
|
ret i32* @bar
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @g() {
|
|
|
|
call i32* @foo()
|
|
|
|
ret void
|
|
|
|
}
|