[PATCH] D54936: [llvm-objcopy] Hook up the -V alias to --version, output "GNU strip"
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 27 04:01:02 PST 2018
mstorsjo updated this revision to Diff 175446.
mstorsjo added a comment.
Changed to keep the check for `{{ version }}` in the llvm-strip output, outputting "compatible with GNU objcopy" as well (but no test for that as I haven't seen a specific need for that string somewhere yet).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54936/new/
https://reviews.llvm.org/D54936
Files:
test/tools/llvm-objcopy/objcopy-version.test
test/tools/llvm-objcopy/strip-version.test
tools/llvm-objcopy/CopyConfig.cpp
tools/llvm-objcopy/ObjcopyOpts.td
tools/llvm-objcopy/StripOpts.td
Index: tools/llvm-objcopy/StripOpts.td
===================================================================
--- tools/llvm-objcopy/StripOpts.td
+++ tools/llvm-objcopy/StripOpts.td
@@ -64,3 +64,4 @@
def version : Flag<["-", "--"], "version">,
HelpText<"Print the version and exit.">;
+def V : Flag<["-"], "V">, Alias<version>;
Index: tools/llvm-objcopy/ObjcopyOpts.td
===================================================================
--- tools/llvm-objcopy/ObjcopyOpts.td
+++ tools/llvm-objcopy/ObjcopyOpts.td
@@ -165,3 +165,4 @@
def version : Flag<["-", "--"], "version">,
HelpText<"Print the version and exit.">;
+def V : Flag<["-"], "V">, Alias<version>;
Index: tools/llvm-objcopy/CopyConfig.cpp
===================================================================
--- tools/llvm-objcopy/CopyConfig.cpp
+++ tools/llvm-objcopy/CopyConfig.cpp
@@ -226,6 +226,7 @@
}
if (InputArgs.hasArg(OBJCOPY_version)) {
+ outs() << "llvm-objcopy, compatible with GNU objcopy\n";
cl::PrintVersionMessage();
exit(0);
}
@@ -383,6 +384,7 @@
}
if (InputArgs.hasArg(STRIP_version)) {
+ outs() << "llvm-strip, compatible with GNU strip\n";
cl::PrintVersionMessage();
exit(0);
}
Index: test/tools/llvm-objcopy/strip-version.test
===================================================================
--- test/tools/llvm-objcopy/strip-version.test
+++ test/tools/llvm-objcopy/strip-version.test
@@ -1,4 +1,6 @@
# RUN: llvm-strip -version | FileCheck %s
# RUN: llvm-strip --version | FileCheck %s
+# RUN: llvm-strip -V | FileCheck %s
-# CHECK: {{ version }}
+# CHECK-DAG: {{ version }}
+# CHECK-DAG: GNU strip
Index: test/tools/llvm-objcopy/objcopy-version.test
===================================================================
--- test/tools/llvm-objcopy/objcopy-version.test
+++ test/tools/llvm-objcopy/objcopy-version.test
@@ -1,4 +1,5 @@
# RUN: llvm-objcopy -version | FileCheck %s
# RUN: llvm-objcopy --version | FileCheck %s
+# RUN: llvm-objcopy -V | FileCheck %s
# CHECK: {{ version }}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54936.175446.patch
Type: text/x-patch
Size: 2061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181127/f44b0eac/attachment.bin>
More information about the llvm-commits
mailing list