[PATCH] D59618: [llvm-objdump] Support llvm-objdump -sj.foo
Jordan Rupprecht via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 21 11:39:33 PDT 2019
rupprecht updated this revision to Diff 191753.
rupprecht added a comment.
Herald added a subscriber: javed.absar.
- Also allow grouping of --disassembler-options
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59618/new/
https://reviews.llvm.org/D59618
Files:
llvm/test/tools/llvm-objdump/ARM/reg-names.s
llvm/test/tools/llvm-objdump/section-filter.test
llvm/tools/llvm-objdump/llvm-objdump.cpp
Index: llvm/tools/llvm-objdump/llvm-objdump.cpp
===================================================================
--- llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -197,7 +197,7 @@
llvm::FilterSections("section", cl::desc("Operate on the specified sections only. "
"With -macho dump segment,section"));
cl::alias static FilterSectionsj("j", cl::desc("Alias for --section"),
- cl::NotHidden,
+ cl::NotHidden, cl::Grouping, cl::Prefix,
cl::aliasopt(llvm::FilterSections));
cl::list<std::string>
@@ -299,7 +299,8 @@
cl::value_desc("options"), cl::CommaSeparated);
static cl::alias
DisassemblerOptionsShort("M", cl::desc("Alias for --disassembler-options"),
- cl::NotHidden, cl::Prefix, cl::CommaSeparated,
+ cl::NotHidden, cl::Grouping, cl::Prefix,
+ cl::CommaSeparated,
cl::aliasopt(DisassemblerOptions));
static StringRef ToolName;
Index: llvm/test/tools/llvm-objdump/section-filter.test
===================================================================
--- llvm/test/tools/llvm-objdump/section-filter.test
+++ llvm/test/tools/llvm-objdump/section-filter.test
@@ -1,7 +1,24 @@
-// This test checks that --section works correctly
+// This test checks that --section works correctly.
// RUN: llvm-objdump -h %p/Inputs/section-filter.obj -j=.text \
// RUN: --section=.bss | FileCheck %s
-# CHECK: .text
-# CHECK-NOT: .data
-# CHECK: .bss
\ No newline at end of file
+// CHECK: .text
+// CHECK-NOT: .data
+// CHECK: .bss
+
+// Test that the -j alias can be used flexibly. Create a baseline and ensure
+// all other combinations are identical.
+// RUN: llvm-objdump %p/Inputs/section-filter.obj -h -s --section .symtab > %t.full
+// RUN: llvm-objdump %p/Inputs/section-filter.obj -h -s -j .symtab > %t.1
+// RUN: llvm-objdump %p/Inputs/section-filter.obj -h -s -j=.symtab > %t.2
+// RUN: llvm-objdump %p/Inputs/section-filter.obj -h -s -j.symtab > %t.3
+// RUN: llvm-objdump %p/Inputs/section-filter.obj -hsj .symtab > %t.4
+// RUN: llvm-objdump %p/Inputs/section-filter.obj -hsj=.symtab > %t.5
+// RUN: llvm-objdump %p/Inputs/section-filter.obj -hsj.symtab > %t.6
+
+// RUN: cmp %t.full %t.1
+// RUN: cmp %t.full %t.2
+// RUN: cmp %t.full %t.3
+// RUN: cmp %t.full %t.4
+// RUN: cmp %t.full %t.5
+// RUN: cmp %t.full %t.6
Index: llvm/test/tools/llvm-objdump/ARM/reg-names.s
===================================================================
--- llvm/test/tools/llvm-objdump/ARM/reg-names.s
+++ llvm/test/tools/llvm-objdump/ARM/reg-names.s
@@ -12,6 +12,24 @@
@ RUN: | FileCheck -check-prefix=ERR %s
@ ERR: Unrecognized disassembler option: unknown
+@ Test that the -M alias can be used flexibly. Create a baseline and ensure
+@ all other combinations are identical.
+@ RUN: llvm-objdump -d --disassembler-options=reg-names-raw %t > %t.raw
+@ RUN: llvm-objdump -d -M reg-names-raw %t > %t.1
+@ RUN: llvm-objdump -d -Mreg-names-raw %t > %t.2
+@ RUN: llvm-objdump -d -Mreg-names-std -Mreg-names-raw %t > %t.3
+@ RUN: llvm-objdump -d -Mreg-names-std,reg-names-raw %t > %t.4
+@ RUN: llvm-objdump -dM reg-names-std,reg-names-raw %t > %t.5
+@ RUN: llvm-objdump -dMreg-names-std,reg-names-raw %t > %t.6
+@ RUN: llvm-objdump -dMreg-names-std -Mreg-names-raw %t > %t.7
+@ RUN: cmp %t.raw %t.1
+@ RUN: cmp %t.raw %t.2
+@ RUN: cmp %t.raw %t.3
+@ RUN: cmp %t.raw %t.4
+@ RUN: cmp %t.raw %t.5
+@ RUN: cmp %t.raw %t.6
+@ RUN: cmp %t.raw %t.7
+
.text
add r13, r14, r15
@ STD: add sp, lr, pc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59618.191753.patch
Type: text/x-patch
Size: 3725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190321/4ab9ae12/attachment.bin>
More information about the llvm-commits
mailing list