[llvm] r270746 - Fix shouldAssumeDSOLocal for private linkage.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed May 25 12:55:16 PDT 2016
Author: rafael
Date: Wed May 25 14:55:16 2016
New Revision: 270746
URL: http://llvm.org/viewvc/llvm-project?rev=270746&view=rev
Log:
Fix shouldAssumeDSOLocal for private linkage.
Added:
llvm/trunk/test/CodeGen/X86/x86-64-pic.ll
Modified:
llvm/trunk/lib/Target/X86/X86Subtarget.cpp
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=270746&r1=270745&r2=270746&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Wed May 25 14:55:16 2016
@@ -66,7 +66,7 @@ static bool shouldAssumeDSOLocal(Reloc::
if (RM == Reloc::Static)
return true;
- if (GV && (GV->hasInternalLinkage() || !GV->hasDefaultVisibility()))
+ if (GV && (GV->hasLocalLinkage() || !GV->hasDefaultVisibility()))
return true;
if (TT.isOSBinFormatELF()) {
Added: llvm/trunk/test/CodeGen/X86/x86-64-pic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-pic.ll?rev=270746&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/x86-64-pic.ll (added)
+++ llvm/trunk/test/CodeGen/X86/x86-64-pic.ll Wed May 25 14:55:16 2016
@@ -0,0 +1,8 @@
+; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic | FileCheck %s
+
+ at g1 = private global i8 1
+define i8* @get_g1() {
+; CHECK: get_g1:
+; CHECK: leaq .Lg1(%rip), %rax
+ ret i8* @g1
+}
More information about the llvm-commits
mailing list