2010-09-23 08:33:13 +08: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.
|
|
|
|
|
2018-01-18 10:08:23 +08:00
|
|
|
; CHECK: define hidden void @foo() comdat($x) {
|
2010-09-23 08:33:13 +08:00
|
|
|
; CHECK: ret void
|
|
|
|
; CHECK: }
|
2010-09-24 01:25:06 +08:00
|
|
|
|
2012-10-29 09:59:03 +08:00
|
|
|
; The private linkage for foo() should be changed to external linkage and
|
|
|
|
; hidden visibility added.
|
2018-01-18 10:08:23 +08:00
|
|
|
; DELETE: declare hidden void @foo()
|
2015-07-07 02:48:02 +08:00
|
|
|
; DELETE-NOT: comdat
|
2010-09-23 08:33:13 +08:00
|
|
|
; DELETE: define void @bar() {
|
2010-09-24 01:25:06 +08:00
|
|
|
; DELETE: call void @foo()
|
2010-09-23 08:33:13 +08:00
|
|
|
; DELETE: ret void
|
|
|
|
; DELETE: }
|
|
|
|
|
2015-07-07 02:48:02 +08:00
|
|
|
$x = comdat any
|
|
|
|
|
|
|
|
define private void @foo() comdat($x) {
|
2010-09-23 08:33:13 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
define void @bar() {
|
2010-09-24 01:25:06 +08:00
|
|
|
call void @foo()
|
2010-09-23 08:33:13 +08:00
|
|
|
ret void
|
|
|
|
}
|