summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp8
-rw-r--r--llvm/test/CodeGen/X86/coff-no-dead-strip.ll5
2 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 87d91377dc9..92429acb2b8 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1456,10 +1456,10 @@ bool AsmPrinter::doFinalization(Module &M) {
for (const Value *Op : A->operands()) {
const auto *GV =
cast<GlobalValue>(Op->stripPointerCastsNoFollowAliases());
- // Global symbols with internal linkage are not visible to the linker,
- // and thus would cause an error when the linker tried to preserve the
- // symbol due to the `/include:` directive.
- if (GV->hasInternalLinkage())
+ // Global symbols with internal or private linkage are not visible to
+ // the linker, and thus would cause an error when the linker tried to
+ // preserve the symbol due to the `/include:` directive.
+ if (GV->hasInternalLinkage() || GV->hasPrivateLinkage())
continue;
raw_string_ostream OS(Flags);
diff --git a/llvm/test/CodeGen/X86/coff-no-dead-strip.ll b/llvm/test/CodeGen/X86/coff-no-dead-strip.ll
index 4f57a0f9b16..f82b5f003aa 100644
--- a/llvm/test/CodeGen/X86/coff-no-dead-strip.ll
+++ b/llvm/test/CodeGen/X86/coff-no-dead-strip.ll
@@ -5,15 +5,18 @@
@j = weak global i32 0
@k = internal global i32 0
declare x86_vectorcallcc void @l()
+@m = private global i32 0
-@llvm.used = appending global [4 x i8*] [i8* bitcast (i32* @i to i8*), i8* bitcast (i32* @j to i8*), i8* bitcast (i32* @k to i8*), i8* bitcast (void ()* @l to i8*)]
+@llvm.used = appending global [5 x i8*] [i8* bitcast (i32* @i to i8*), i8* bitcast (i32* @j to i8*), i8* bitcast (i32* @k to i8*), i8* bitcast (void ()* @l to i8*), i8* bitcast (i32* @m to i8*)]
; CHECK: .section .drectve
; CHECK-ULP: .ascii " /INCLUDE:_i"
; CHECK-ULP: .ascii " /INCLUDE:_j"
; CHECK-ULP-NOT: .ascii " /INCLUDE:_k"
+; CHECK-ULP-NOT: .ascii " /INCLUDE:L_m"
; CHECK-NOULP: .ascii " /INCLUDE:i"
; CHECK-NOULP: .ascii " /INCLUDE:j"
; CHECK-NOULP-NOT: .ascii " /INCLUDE:k"
+; CHECK-NOULP-NOT: .ascii " /INCLUDE:.Lm"
; CHECK: .ascii " /INCLUDE:l@@0"
OpenPOWER on IntegriCloud