forked from OSchip/llvm-project
Add a missing error handling to llvm-lto.
llvm-svn: 257395
This commit is contained in:
parent
f225a63849
commit
5a7756044f
|
@ -0,0 +1,2 @@
|
||||||
|
; RUN: not llvm-lto foobar 2>&1 | FileCheck %s
|
||||||
|
; CHECK: llvm-lto: error loading file 'foobar': No such file or directory
|
|
@ -289,6 +289,7 @@ int main(int argc, char **argv) {
|
||||||
CurrentActivity = "loading file '" + InputFilenames[i] + "'";
|
CurrentActivity = "loading file '" + InputFilenames[i] + "'";
|
||||||
ErrorOr<std::unique_ptr<LTOModule>> ModuleOrErr =
|
ErrorOr<std::unique_ptr<LTOModule>> ModuleOrErr =
|
||||||
LTOModule::createFromFile(Context, InputFilenames[i].c_str(), Options);
|
LTOModule::createFromFile(Context, InputFilenames[i].c_str(), Options);
|
||||||
|
error(ModuleOrErr, "error " + CurrentActivity);
|
||||||
std::unique_ptr<LTOModule> &Module = *ModuleOrErr;
|
std::unique_ptr<LTOModule> &Module = *ModuleOrErr;
|
||||||
CurrentActivity = "";
|
CurrentActivity = "";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue