[PATCH] D126497: [lld][WebAssemlby] Check for command line flags with missing arguments
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 26 13:23:19 PDT 2022
sbc100 updated this revision to Diff 432372.
sbc100 added a comment.
- split
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126497/new/
https://reviews.llvm.org/D126497
Files:
lld/test/wasm/driver.s
lld/wasm/Driver.cpp
Index: lld/wasm/Driver.cpp
===================================================================
--- lld/wasm/Driver.cpp
+++ lld/wasm/Driver.cpp
@@ -184,6 +184,9 @@
args = this->ParseArgs(vec, missingIndex, missingCount);
handleColorDiagnostics(args);
+ if (missingCount)
+ error(Twine(args.getArgString(missingIndex)) + ": missing argument");
+
for (auto *arg : args.filtered(OPT_UNKNOWN))
error("unknown argument: " + arg->getAsString(args));
return args;
Index: lld/test/wasm/driver.s
===================================================================
--- lld/test/wasm/driver.s
+++ lld/test/wasm/driver.s
@@ -5,6 +5,9 @@
.functype _start () -> ()
end_function
+# RUN: not wasm-ld %t -o 2>&1 | FileCheck --check-prefix=NO_O_VAL %s
+# NO_O_VAL: error: -o: missing argument
+
# RUN: not wasm-ld -o %t.exe 2>&1 | FileCheck -check-prefix=IN %s
# IN: error: no input files
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126497.432372.patch
Type: text/x-patch
Size: 905 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220526/605f18a5/attachment.bin>
More information about the llvm-commits
mailing list