summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp6
-rw-r--r--llvm/test/Linker/Inputs/comdat13.ll9
-rw-r--r--llvm/test/Linker/comdat13.ll13
3 files changed, 1 insertions, 27 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index aeaa7eb9090..edee55a1f9f 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -940,12 +940,8 @@ void ModuleLinker::materializeInitFor(GlobalValue *New, GlobalValue *Old) {
if (isPerformingImport() && !doImportAsDefinition(Old))
return;
- if (DoNotLinkFromSource.count(Old)) {
- if (!New->hasExternalLinkage() && !New->hasExternalWeakLinkage() &&
- !New->hasAppendingLinkage())
- emitError("Declaration points to discarded value");
+ if (DoNotLinkFromSource.count(Old))
return;
- }
linkGlobalValueBody(*Old);
}
diff --git a/llvm/test/Linker/Inputs/comdat13.ll b/llvm/test/Linker/Inputs/comdat13.ll
deleted file mode 100644
index a2d16bd261b..00000000000
--- a/llvm/test/Linker/Inputs/comdat13.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-$foo = comdat any
-@foo = global i8 1, comdat
-define void @zed() {
- call void @bar()
- ret void
-}
-define internal void @bar() comdat($foo) {
- ret void
-}
diff --git a/llvm/test/Linker/comdat13.ll b/llvm/test/Linker/comdat13.ll
deleted file mode 100644
index a8e51f04ae1..00000000000
--- a/llvm/test/Linker/comdat13.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: not llvm-link -S %s %p/Inputs/comdat13.ll -o %t.ll 2>&1 | FileCheck %s
-
-; In Inputs/comdat13.ll a function not in the $foo comdat (zed) references an
-; internal function in the comdat $foo.
-; We might want to have the verifier reject that, but for now we at least check
-; that the linker produces an error.
-; This is the IR equivalent of the "relocation refers to discarded section" in
-; an ELF linker.
-
-; CHECK: Declaration points to discarded value
-
-$foo = comdat any
-@foo = global i8 0, comdat
OpenPOWER on IntegriCloud