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.

llvm-svn: 266236
This commit is contained in:
Peter Collingbourne 2016-04-13 19:36:04 +00:00
parent 0fc66f4b8f
commit 6f750292da
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"; llvm::errs() << "ignoring unknown argument: " << Arg->getSpelling() << "\n";
if (Args.filtered_begin(OPT_INPUT) == Args.filtered_end()) { if (Args.filtered_begin(OPT_INPUT) == Args.filtered_end()) {
llvm::errs() << "no input files.\n"; // No input files. To match lib.exe, silently do nothing.
return 1; return 0;
} }
std::vector<StringRef> SearchPaths = getSearchPaths(&Args, Saver); std::vector<StringRef> SearchPaths = getSearchPaths(&Args, Saver);

View File

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