[PATCH] D43408: Do not print out "no input files" twice.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 16 15:01:58 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL325406: Do not print out "no input files" twice. (authored by ruiu, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D43408?vs=134732&id=134738#toc
Repository:
rL LLVM
https://reviews.llvm.org/D43408
Files:
lld/trunk/test/wasm/driver.ll
lld/trunk/wasm/Driver.cpp
Index: lld/trunk/test/wasm/driver.ll
===================================================================
--- lld/trunk/test/wasm/driver.ll
+++ lld/trunk/test/wasm/driver.ll
@@ -0,0 +1,18 @@
+; RUN: llc -filetype=obj %s -o %t.o
+
+target triple = "wasm32-unknown-unknown-wasm"
+
+define hidden void @entry() local_unnamed_addr #0 {
+entry:
+ ret void
+}
+
+; RUN: not wasm-ld -o %t.exe 2>&1 | FileCheck -check-prefix=IN %s
+; IN: error: no input files
+
+; RUN: not wasm-ld %t.o 2>&1 | FileCheck -check-prefix=OUT %s
+; OUT: error: no output file specified
+
+; RUN: not wasm-ld 2>&1 | FileCheck -check-prefix=BOTH %s
+; BOTH: error: no input files
+; BOTH-NOT: error: no output file specified
Index: lld/trunk/wasm/Driver.cpp
===================================================================
--- lld/trunk/wasm/Driver.cpp
+++ lld/trunk/wasm/Driver.cpp
@@ -211,9 +211,6 @@
break;
}
}
-
- if (Files.empty())
- error("no input files");
}
static StringRef getEntry(opt::InputArgList &Args, StringRef Default) {
@@ -280,12 +277,14 @@
if (auto *Arg = Args.getLastArg(OPT_allow_undefined_file))
readImportFile(Arg->getValue());
+ if (!Args.hasArg(OPT_INPUT)) {
+ error("no input files");
+ return;
+ }
+
if (Config->OutputFile.empty())
error("no output file specified");
- if (!Args.hasArg(OPT_INPUT))
- error("no input files");
-
if (Config->Relocatable) {
if (!Config->Entry.empty())
error("entry point specified for relocatable output file");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43408.134738.patch
Type: text/x-patch
Size: 1516 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180216/851f4fe2/attachment.bin>
More information about the llvm-commits
mailing list