summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objcopy/ELF
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-04-26 02:10:10 +0000
committerFangrui Song <maskray@google.com>2019-04-26 02:10:10 +0000
commit2db79e9d2cacc7a387d3e1e6bf0f6ac0a7d5d292 (patch)
treef9e9ccdcef9c81438e8e9a60cc98bb462fd3e291 /llvm/test/tools/llvm-objcopy/ELF
parent48e7a2fa8cf072749b8f7b1baa7aaa38e710b68d (diff)
downloadbcm5719-llvm-2db79e9d2cacc7a387d3e1e6bf0f6ac0a7d5d292.tar.gz
bcm5719-llvm-2db79e9d2cacc7a387d3e1e6bf0f6ac0a7d5d292.zip
[llvm-objcopy] Accept --long-option but not -long-option
Summary: llvm-{objcopy,strip} (and many other LLVM binary utilities) accept cl::opt style -long-option as well as many short options (e.g. -p -S -x). People who use them as replacement of GNU binutils often use the grouped option syntax (POSIX Utility Conventions), e.g. -Sx => -S -x, -Wd => -W -d, -sj.text => -s -j.text There is ambiguity if a long option starts with the character used by a short option. Drop the support for -long-option to resolve the ambiguity. This divergence from other utilities is accepted (other utilities continue supporting -long-option). https://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html Reviewers: alexshap, jakehehrlich, jhenderson, rupprecht, espindola Reviewed By: jakehehrlich, jhenderson, rupprecht Subscribers: grimar, emaste, arichardson, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60439 llvm-svn: 359265
Diffstat (limited to 'llvm/test/tools/llvm-objcopy/ELF')
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/help-message.test4
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/objcopy-version.test1
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/strip-all.test18
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/strip-version.test1
4 files changed, 9 insertions, 15 deletions
diff --git a/llvm/test/tools/llvm-objcopy/ELF/help-message.test b/llvm/test/tools/llvm-objcopy/ELF/help-message.test
index 2dc92f67310..b0e9cf6c0e1 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/help-message.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/help-message.test
@@ -1,11 +1,11 @@
-# RUN: llvm-objcopy -help | FileCheck --check-prefix=OBJCOPY-USAGE %s
+# RUN: llvm-objcopy -h | FileCheck --check-prefix=OBJCOPY-USAGE %s
# RUN: llvm-objcopy --help | FileCheck --check-prefix=OBJCOPY-USAGE %s
# RUN: not llvm-objcopy 2>&1 | FileCheck --check-prefix=OBJCOPY-USAGE %s
# RUN: not llvm-objcopy -abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s
# RUN: not llvm-objcopy --abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s
# RUN: not llvm-objcopy --strip-debug 2>&1 | FileCheck %s --check-prefix=NO-INPUT-FILES
-# RUN: llvm-strip -help | FileCheck --check-prefix=STRIP-USAGE %s
+# RUN: llvm-strip -h | FileCheck --check-prefix=STRIP-USAGE %s
# RUN: llvm-strip --help | FileCheck --check-prefix=STRIP-USAGE %s
# RUN: not llvm-strip 2>&1 | FileCheck --check-prefix=STRIP-USAGE %s
# RUN: not llvm-strip -abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s
diff --git a/llvm/test/tools/llvm-objcopy/ELF/objcopy-version.test b/llvm/test/tools/llvm-objcopy/ELF/objcopy-version.test
index f2f7fa05306..7494ccd2866 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/objcopy-version.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/objcopy-version.test
@@ -1,4 +1,3 @@
-# RUN: llvm-objcopy -version | FileCheck %s
# RUN: llvm-objcopy --version | FileCheck %s
# RUN: llvm-objcopy -V | FileCheck %s
diff --git a/llvm/test/tools/llvm-objcopy/ELF/strip-all.test b/llvm/test/tools/llvm-objcopy/ELF/strip-all.test
index 32a801d7a6c..dabb9ef6a91 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/strip-all.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/strip-all.test
@@ -28,27 +28,23 @@
# RUN: cmp %t2 %t6
# RUN: cp %t %t7
-# RUN: llvm-strip -strip-all %t7
+# RUN: llvm-strip --strip-all %t7
# RUN: cmp %t2 %t7
# RUN: cp %t %t8
-# RUN: llvm-strip --strip-all %t8
+# RUN: llvm-objcopy -S %t8 %t8
# RUN: cmp %t2 %t8
# RUN: cp %t %t9
-# RUN: llvm-objcopy -S %t9 %t9
+# RUN: llvm-strip -s %t9
# RUN: cmp %t2 %t9
-# RUN: cp %t %t10
-# RUN: llvm-strip -s %t10
-# RUN: cmp %t2 %t10
-
# Verify that a non-existent symbol table (after first call to llvm-strip)
# can be handled correctly.
-# RUN: cp %t %t11
-# RUN: llvm-strip --strip-all --keep-symbol=unavailable_symbol %t11
-# RUN: llvm-strip --strip-all --keep-symbol=unavailable_symbol %t11
-# RUN: cmp %t2 %t11
+# RUN: cp %t %t10
+# RUN: llvm-strip --strip-all --keep-symbol=unavailable_symbol %t10
+# RUN: llvm-strip --strip-all --keep-symbol=unavailable_symbol %t10
+# RUN: cmp %t2 %t10
!ELF
FileHeader:
diff --git a/llvm/test/tools/llvm-objcopy/ELF/strip-version.test b/llvm/test/tools/llvm-objcopy/ELF/strip-version.test
index d1d3165106a..4b2f137ce2a 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/strip-version.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/strip-version.test
@@ -1,4 +1,3 @@
-# RUN: llvm-strip -version | FileCheck %s
# RUN: llvm-strip --version | FileCheck %s
# RUN: llvm-strip -V | FileCheck %s
OpenPOWER on IntegriCloud