diff options
-rw-r--r-- | llvm/lib/LibDriver/LibDriver.cpp | 4 | ||||
-rw-r--r-- | llvm/test/LibDriver/no-inputs.test | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/LibDriver/LibDriver.cpp b/llvm/lib/LibDriver/LibDriver.cpp index 3ae54346074..671cc73c576 100644 --- a/llvm/lib/LibDriver/LibDriver.cpp +++ b/llvm/lib/LibDriver/LibDriver.cpp @@ -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); diff --git a/llvm/test/LibDriver/no-inputs.test b/llvm/test/LibDriver/no-inputs.test new file mode 100644 index 00000000000..95d6555d58c --- /dev/null +++ b/llvm/test/LibDriver/no-inputs.test @@ -0,0 +1,2 @@ +RUN: llvm-lib -out:%t.a +RUN: test ! -e %t.a |