Skip to content

Commit

Permalink
Add a test for r263577: "Add missing error handling in llvm-lto"
Browse files Browse the repository at this point in the history
On Rafael's suggestion!
(also fix a discrepancy between this error message format and the others)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263860
  • Loading branch information
joker-eph committed Mar 19, 2016
1 parent 579e70c commit 155da5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions llvm/test/tools/llvm-lto/error.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

; RUN: not llvm-lto --list-symbols-only %S/Inputs/empty.bc 2>&1 | FileCheck %s --check-prefix=CHECK-LIST
; CHECK-LIST: llvm-lto: error loading file '{{.*}}/Inputs/empty.bc': The file was not recognized as a valid object file

; RUN: not llvm-lto --thinlto %S/Inputs/empty.bc 2>&1 | FileCheck %s --check-prefix=CHECK-THIN
; CHECK-THIN: llvm-lto: error loading file '{{.*}}/Inputs/empty.bc': The file was not recognized as a valid object file
2 changes: 1 addition & 1 deletion llvm/tools/llvm-lto/llvm-lto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static void createCombinedModuleSummaryIndex() {
CurrentActivity = "loading file '" + Filename + "'";
ErrorOr<std::unique_ptr<ModuleSummaryIndex>> IndexOrErr =
llvm::getModuleSummaryIndexForFile(Filename, diagnosticHandler);
error(IndexOrErr, "error: " + CurrentActivity);
error(IndexOrErr, "error " + CurrentActivity);
std::unique_ptr<ModuleSummaryIndex> Index = std::move(IndexOrErr.get());
CurrentActivity = "";
// Skip files without a module summary.
Expand Down

0 comments on commit 155da5b

Please sign in to comment.