LibDriver: Silently do nothing when provided no inputs.

This behavior is strange, but it matches lib.exe. Based on a patch by
Nico Weber.

Fixes PR27335.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266236 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Peter Collingbourne 2016-04-13 19:36:04 +00:00
parent 5a486ec618
commit 9e81c60d6e
2 changed files with 4 additions and 2 deletions

View File

@ -122,8 +122,8 @@ int llvm::libDriverMain(llvm::ArrayRef<const char*> ArgsArr) {
llvm::errs() << "ignoring unknown argument: " << Arg->getSpelling() << "\n";
if (Args.filtered_begin(OPT_INPUT) == Args.filtered_end()) {
llvm::errs() << "no input files.\n";
return 1;
// No input files. To match lib.exe, silently do nothing.
return 0;
}
std::vector<StringRef> SearchPaths = getSearchPaths(&Args, Saver);

View File

@ -0,0 +1,2 @@
RUN: llvm-lib -out:%t.a
RUN: test ! -e %t.a