[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:24:11 PDT 2019
rupprecht updated this revision to Diff 191748.
rupprecht marked an inline comment as done.
rupprecht added a comment.
- Use // comments consistently
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/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>
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59618.191748.patch
Type: text/x-patch
Size: 2075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190321/c7a15804/attachment.bin>
More information about the llvm-commits
mailing list