llvm-6502/test/Transforms/GlobalOpt/hidden.ll
Rafael Espindola a0706a9ff4 If a constant or a function has linkonce_odr linkage and unnamed_addr, mark it
hidden. Being linkonce_odr guarantees that it is available in every dso that
needs it. Being a constant/function with unnamed_addr guarantees that the
copies don't have to be merged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159136 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-25 14:30:31 +00:00

15 lines
341 B
LLVM

; RUN: opt %s -globalopt -S | FileCheck %s
@foo = linkonce_odr unnamed_addr constant i32 42
; CHECK: @foo = linkonce_odr hidden unnamed_addr constant i32 42
define linkonce_odr void @bar() unnamed_addr {
; CHECK: define linkonce_odr hidden void @bar() unnamed_addr {
ret void
}
define i32* @zed() {
call void @bar()
ret i32* @foo
}