From 540c3d23df1fa0c0e369be768e9ff08bd87799ae Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 25 Jun 2012 14:30:31 +0000 Subject: 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. llvm-svn: 159136 --- llvm/test/Transforms/GlobalOpt/hidden.ll | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 llvm/test/Transforms/GlobalOpt/hidden.ll (limited to 'llvm/test/Transforms/GlobalOpt/hidden.ll') diff --git a/llvm/test/Transforms/GlobalOpt/hidden.ll b/llvm/test/Transforms/GlobalOpt/hidden.ll new file mode 100644 index 00000000000..301e158d534 --- /dev/null +++ b/llvm/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 +} -- cgit v1.2.3