diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-09-03 23:34:36 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-09-03 23:34:36 +0000 |
commit | 79869ee59abc3aeebda6e15540273a7e5936adb4 (patch) | |
tree | 00091e22e94e2126f6fff3a2ca6d15b68d97aadf /test | |
parent | 4b3e5f24ecedc075a3d9f1a5bdb77190a3a01f22 (diff) | |
download | external_llvm-79869ee59abc3aeebda6e15540273a7e5936adb4.zip external_llvm-79869ee59abc3aeebda6e15540273a7e5936adb4.tar.gz external_llvm-79869ee59abc3aeebda6e15540273a7e5936adb4.tar.bz2 |
Add r159136 back now that pr13124 has been fixed.
Original message:
If a constant or a function has linkonce_odr linkage and unnamed_addr, mark
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@189886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/GlobalOpt/hidden.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Transforms/GlobalOpt/hidden.ll b/test/Transforms/GlobalOpt/hidden.ll new file mode 100644 index 0000000..301e158 --- /dev/null +++ b/test/Transforms/GlobalOpt/hidden.ll @@ -0,0 +1,14 @@ +; 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 +} |