We should still claim them and tell gold about the error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214214
91177308-0d34-0410-b5e6-
96231b3b80d8
--- /dev/null
+; RUN: not ld -plugin %llvmshlibdir/LLVMgold.so \
+; RUN: %p/Inputs/invalid.bc -o %t2 2>&1 | FileCheck %s
+
+; test that only one error gets printed
+
+; CHECK: error: LLVM gold plugin has failed to create LTO module: Malformed block
+; CHECK-NOT: error
if (!LTOModule::isBitcodeFile(view, file->filesize))
return LDPS_OK;
+ *claimed = 1;
+
std::string Error;
LTOModule *M =
LTOModule::createFromBuffer(view, file->filesize, TargetOpts, Error);
(*message)(LDPL_ERROR,
"LLVM gold plugin has failed to create LTO module: %s",
Error.c_str());
- return LDPS_OK;
+ return LDPS_ERR;
}
- *claimed = 1;
Modules.resize(Modules.size() + 1);
claimed_file &cf = Modules.back();