diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-26 10:35:01 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-26 10:35:01 +0000 |
commit | aa309b1a81e669ee80754ed0fe2d30dc32bfb6ad (patch) | |
tree | 3b6e97718270aca2c975d0c6554801d49b5b48ec /llvm/test | |
parent | 6e2f32c56123d5ab83051ef8641a8f7d3db505be (diff) | |
download | bcm5719-llvm-aa309b1a81e669ee80754ed0fe2d30dc32bfb6ad.tar.gz bcm5719-llvm-aa309b1a81e669ee80754ed0fe2d30dc32bfb6ad.zip |
ThinLTOCodeGenerator: preserve linkonce when in "MustPreserved" set
If the linker specifically requested for a linkonce to be preserved,
we need to make sure we won't drop it even if all the uses in the
current module disappear.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267543
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/ThinLTO/X86/odr_resolution.ll | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/ThinLTO/X86/odr_resolution.ll b/llvm/test/ThinLTO/X86/odr_resolution.ll index 4292dfcba03..a2e0997b4b6 100644 --- a/llvm/test/ThinLTO/X86/odr_resolution.ll +++ b/llvm/test/ThinLTO/X86/odr_resolution.ll @@ -6,6 +6,8 @@ ; Verify that only one ODR is selected across modules, but non ODR are not affected. ; RUN: llvm-lto -thinlto-action=promote %t.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=MOD1 ; RUN: llvm-lto -thinlto-action=promote %t2.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=MOD2 +; When exported, we always preserve a linkonce +; RUN: llvm-lto -thinlto-action=promote %t.bc -thinlto-index=%t3.bc -o - --exported-symbol=linkonceodrfuncInSingleModule | llvm-dis -o - | FileCheck %s --check-prefix=EXPORTED target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.11.0" @@ -48,3 +50,9 @@ entry: ret void } +; MOD1: define linkonce_odr void @linkonceodrfuncInSingleModule() +; EXPORTED: define weak_odr void @linkonceodrfuncInSingleModule() +define linkonce_odr void @linkonceodrfuncInSingleModule() #0 { +entry: + ret void +} |