[llvm] r266236 - LibDriver: Silently do nothing when provided no inputs.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 13 12:36:05 PDT 2016
Author: pcc
Date: Wed Apr 13 14:36:04 2016
New Revision: 266236
URL: http://llvm.org/viewvc/llvm-project?rev=266236&view=rev
Log:
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.
Added:
llvm/trunk/test/LibDriver/no-inputs.test
Modified:
llvm/trunk/lib/LibDriver/LibDriver.cpp
Modified: llvm/trunk/lib/LibDriver/LibDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LibDriver/LibDriver.cpp?rev=266236&r1=266235&r2=266236&view=diff
==============================================================================
--- llvm/trunk/lib/LibDriver/LibDriver.cpp (original)
+++ llvm/trunk/lib/LibDriver/LibDriver.cpp Wed Apr 13 14:36:04 2016
@@ -122,8 +122,8 @@ int llvm::libDriverMain(llvm::ArrayRef<c
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);
Added: llvm/trunk/test/LibDriver/no-inputs.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LibDriver/no-inputs.test?rev=266236&view=auto
==============================================================================
--- llvm/trunk/test/LibDriver/no-inputs.test (added)
+++ llvm/trunk/test/LibDriver/no-inputs.test Wed Apr 13 14:36:04 2016
@@ -0,0 +1,2 @@
+RUN: llvm-lib -out:%t.a
+RUN: test ! -e %t.a
More information about the llvm-commits
mailing list