mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-31 16:02:52 +01:00
ba8dee024f
GlobalValue linkage up to ExternalLinkage in the ExtractGV pass. This prevents linkonce and linkonce_odr symbols from being DCE'd. llvm-svn: 176459
24 lines
544 B
LLVM
24 lines
544 B
LLVM
; RUN: llvm-extract -func foo -S < %s | FileCheck %s
|
|
; RUN: llvm-extract -delete -func foo -S < %s | FileCheck --check-prefix=DELETE %s
|
|
|
|
; Test that we don't convert weak_odr to external definitions.
|
|
|
|
; CHECK: @bar = external hidden global i32
|
|
; CHECK: define hidden i32* @foo() {
|
|
; CHECK-NEXT: ret i32* @bar
|
|
; CHECK-NEXT: }
|
|
|
|
; DELETE: @bar = hidden global i32 42
|
|
; DELETE: declare hidden i32* @foo()
|
|
|
|
@bar = linkonce global i32 42
|
|
|
|
define linkonce i32* @foo() {
|
|
ret i32* @bar
|
|
}
|
|
|
|
define void @g() {
|
|
call i32* @foo()
|
|
ret void
|
|
}
|