2010-09-23 00:33:13 +00:00
|
|
|
; RUN: llvm-extract -func foo -S < %s | FileCheck %s
|
|
|
|
; RUN: llvm-extract -delete -func foo -S < %s | FileCheck --check-prefix=DELETE %s
|
|
|
|
; RUN: llvm-as < %s > %t
|
|
|
|
; RUN: llvm-extract -func foo -S %t | FileCheck %s
|
|
|
|
; RUN: llvm-extract -delete -func foo -S %t | FileCheck --check-prefix=DELETE %s
|
|
|
|
|
|
|
|
; llvm-extract uses lazy bitcode loading, so make sure it correctly reads
|
|
|
|
; from bitcode files in addition to assembly files.
|
|
|
|
|
2012-10-29 01:59:03 +00:00
|
|
|
; CHECK: define hidden void @foo() {
|
2010-09-23 00:33:13 +00:00
|
|
|
; CHECK: ret void
|
|
|
|
; CHECK: }
|
2010-09-23 17:25:06 +00:00
|
|
|
|
2012-10-29 01:59:03 +00:00
|
|
|
; The private linkage for foo() should be changed to external linkage and
|
|
|
|
; hidden visibility added.
|
|
|
|
; DELETE: declare hidden void @foo()
|
2010-09-23 00:33:13 +00:00
|
|
|
; DELETE: define void @bar() {
|
2010-09-23 17:25:06 +00:00
|
|
|
; DELETE: call void @foo()
|
2010-09-23 00:33:13 +00:00
|
|
|
; DELETE: ret void
|
|
|
|
; DELETE: }
|
|
|
|
|
2012-10-29 01:59:03 +00:00
|
|
|
define private void @foo() {
|
2010-09-23 00:33:13 +00:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
define void @bar() {
|
2010-09-23 17:25:06 +00:00
|
|
|
call void @foo()
|
2010-09-23 00:33:13 +00:00
|
|
|
ret void
|
|
|
|
}
|