mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 06:10:48 +00:00
Revert "Revert "[llvm-objdump] Allow short options without arguments to be grouped""
- Tests that use multiple short switches now test them grouped and ungrouped. - Ensure the output of ungrouped and grouped variants is identical Differential Revision: https://reviews.llvm.org/D57904 llvm-svn: 354375
This commit is contained in:
parent
d5b0d52a8c
commit
3fb0589d43
@ -1,4 +1,7 @@
|
||||
RUN: llvm-objdump -d -m -no-show-raw-insn -arch all %p/Inputs/fat.macho-armv7s-arm64 | FileCheck %s
|
||||
RUN: llvm-objdump -d -m -no-show-raw-insn -arch all %p/Inputs/fat.macho-armv7s-arm64 >%t0
|
||||
RUN: llvm-objdump -dm -no-show-raw-insn -arch all %p/Inputs/fat.macho-armv7s-arm64 >%t1
|
||||
RUN: cmp %t0 %t1
|
||||
RUN: FileCheck --input-file %t0 %s
|
||||
REQUIRES: arm-registered-target
|
||||
|
||||
CHECK: (architecture armv7s):
|
||||
|
@ -1,5 +1,5 @@
|
||||
// RUN: yaml2obj -o %t.out %p/Inputs/simple-executable-x86_64.yaml
|
||||
// RUN: llvm-objdump -d %t.out -df=main | FileCheck %s
|
||||
// RUN: llvm-objdump -d %t.out -disassemble-functions=main | FileCheck %s
|
||||
|
||||
// CHECK: Disassembly of section .anothertext:
|
||||
// CHECK-NEXT: main:
|
||||
|
@ -1,4 +1,7 @@
|
||||
// RUN: dsymutil -f -oso-prepend-path=%p/../../dsymutil/ %p/../../dsymutil/Inputs/basic.macho.x86_64 -o %t1.dSYM
|
||||
// RUN: llvm-objdump -d -g -dsym=%t1.dSYM %p/../../dsymutil/Inputs/basic.macho.x86_64 | FileCheck %s
|
||||
// RUN: llvm-objdump -d -g -dsym=%t1.dSYM %p/../../dsymutil/Inputs/basic.macho.x86_64 >%t0
|
||||
// RUN: llvm-objdump -dg -dsym=%t1.dSYM %p/../../dsymutil/Inputs/basic.macho.x86_64 >%t1
|
||||
// RUN: cmp %t0 %t1
|
||||
// RUN: FileCheck --input-file %t0 %s
|
||||
|
||||
CHECK: Disassembly of section __TEXT,__text:
|
||||
|
@ -1,6 +1,9 @@
|
||||
// Check that llvm-objdump does not attempt to disassemble symbols outside
|
||||
// of section boundaries.
|
||||
// RUN: llvm-objdump -d -t %p/Inputs/out-of-section-sym.elf-i386 | FileCheck %s
|
||||
// RUN: llvm-objdump -d -t %p/Inputs/out-of-section-sym.elf-i386 >%t0
|
||||
// RUN: llvm-objdump -dt %p/Inputs/out-of-section-sym.elf-i386 >%t1
|
||||
// RUN: cmp %t0 %t1
|
||||
// RUN: FileCheck --input-file %t0 %s
|
||||
|
||||
CHECK: Disassembly of section .text:
|
||||
CHECK-NEXT: _start:
|
||||
|
@ -1,8 +1,16 @@
|
||||
; REQUIRES: shell
|
||||
; RUN: sed -e "s,SRC_COMPDIR,%p/Inputs,g" %s > %t.ll
|
||||
; RUN: llc -o %t.o -filetype=obj -mtriple=x86_64-pc-linux %t.ll
|
||||
; RUN: llvm-objdump -d -l %t.o | FileCheck --check-prefix="LINES" %t.ll
|
||||
; RUN: llvm-objdump -d -S %t.o | FileCheck --check-prefix="SOURCE" %t.ll
|
||||
; RUN: llvm-objdump -d -l %t.o >%t0
|
||||
; RUN: llvm-objdump -dl %t.o >%t1
|
||||
; RUN: llvm-objdump -d -S %t.o >%t2
|
||||
; RUN: llvm-objdump -dS %t.o >%t3
|
||||
; RUN: cmp %t0 %t1
|
||||
; RUN: cmp %t2 %t3
|
||||
; RUN: FileCheck --input-file %t0 --check-prefix="LINES" %t.ll
|
||||
; RUN: FileCheck --input-file %t1 --check-prefix="LINES" %t.ll
|
||||
; RUN: FileCheck --input-file %t2 --check-prefix="SOURCE" %t.ll
|
||||
; RUN: FileCheck --input-file %t3 --check-prefix="SOURCE" %t.ll
|
||||
; ModuleID = 'source-interleave-x86_64.bc'
|
||||
source_filename = "source-interleave-x86_64.c"
|
||||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
||||
|
5
test/tools/llvm-objdump/option-grouping.test
Normal file
5
test/tools/llvm-objdump/option-grouping.test
Normal file
@ -0,0 +1,5 @@
|
||||
// RUN: llvm-objdump -afxz %p/Inputs/private-headers-x86_64.elf 2>&1 >%t0
|
||||
// RUN: llvm-objdump -a -f -x -z %p/Inputs/private-headers-x86_64.elf 2>&1 >%t1
|
||||
// RUN: cmp %t0 %t1
|
||||
// RUN: FileCheck --input-file %t0 %s
|
||||
// CHECK-NOT: Unknown command line argument
|
@ -59,7 +59,7 @@ using namespace llvm;
|
||||
using namespace object;
|
||||
|
||||
static cl::opt<bool>
|
||||
UseDbg("g",
|
||||
UseDbg("g", cl::Grouping,
|
||||
cl::desc("Print line information from debug info if available"));
|
||||
|
||||
static cl::opt<std::string> DSYMFile("dsym",
|
||||
|
@ -79,7 +79,8 @@ cl::opt<bool>
|
||||
llvm::AllHeaders("all-headers",
|
||||
cl::desc("Display all available header information"));
|
||||
static cl::alias AllHeadersShort("x", cl::desc("Alias for --all-headers"),
|
||||
cl::NotHidden, cl::aliasopt(AllHeaders));
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(AllHeaders));
|
||||
|
||||
static cl::list<std::string>
|
||||
InputFilenames(cl::Positional, cl::desc("<input object files>"),cl::ZeroOrMore);
|
||||
@ -88,22 +89,25 @@ cl::opt<bool>
|
||||
llvm::Disassemble("disassemble",
|
||||
cl::desc("Display assembler mnemonics for the machine instructions"));
|
||||
static cl::alias Disassembled("d", cl::desc("Alias for --disassemble"),
|
||||
cl::NotHidden, cl::aliasopt(Disassemble));
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(Disassemble));
|
||||
|
||||
cl::opt<bool>
|
||||
llvm::DisassembleAll("disassemble-all",
|
||||
cl::desc("Display assembler mnemonics for the machine instructions"));
|
||||
static cl::alias DisassembleAlld("D", cl::desc("Alias for --disassemble-all"),
|
||||
cl::NotHidden, cl::aliasopt(DisassembleAll));
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(DisassembleAll));
|
||||
|
||||
cl::opt<bool> llvm::Demangle("demangle", cl::desc("Demangle symbols names"),
|
||||
cl::init(false));
|
||||
|
||||
static cl::alias DemangleShort("C", cl::desc("Alias for --demangle"),
|
||||
cl::NotHidden, cl::aliasopt(llvm::Demangle));
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(llvm::Demangle));
|
||||
|
||||
static cl::list<std::string>
|
||||
DisassembleFunctions("df",
|
||||
DisassembleFunctions("disassemble-functions",
|
||||
cl::CommaSeparated,
|
||||
cl::desc("List of functions to disassemble"));
|
||||
static StringSet<> DisasmFuncsSet;
|
||||
@ -112,14 +116,14 @@ cl::opt<bool>
|
||||
llvm::Relocations("reloc",
|
||||
cl::desc("Display the relocation entries in the file"));
|
||||
static cl::alias RelocationsShort("r", cl::desc("Alias for --reloc"),
|
||||
cl::NotHidden,
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(llvm::Relocations));
|
||||
|
||||
cl::opt<bool>
|
||||
llvm::DynamicRelocations("dynamic-reloc",
|
||||
cl::desc("Display the dynamic relocation entries in the file"));
|
||||
static cl::alias DynamicRelocationsd("R", cl::desc("Alias for --dynamic-reloc"),
|
||||
cl::NotHidden,
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(DynamicRelocations));
|
||||
|
||||
cl::opt<bool>
|
||||
@ -127,12 +131,12 @@ cl::opt<bool>
|
||||
cl::desc("Display the content of each section"));
|
||||
static cl::alias SectionContentsShort("s",
|
||||
cl::desc("Alias for --full-contents"),
|
||||
cl::NotHidden,
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(SectionContents));
|
||||
|
||||
cl::opt<bool> llvm::SymbolTable("syms", cl::desc("Display the symbol table"));
|
||||
static cl::alias SymbolTableShort("t", cl::desc("Alias for --syms"),
|
||||
cl::NotHidden,
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(llvm::SymbolTable));
|
||||
|
||||
cl::opt<bool>
|
||||
@ -157,7 +161,7 @@ llvm::RawClangAST("raw-clang-ast",
|
||||
static cl::opt<bool>
|
||||
MachOOpt("macho", cl::desc("Use MachO specific object file parser"));
|
||||
static cl::alias MachOm("m", cl::desc("Alias for --macho"), cl::NotHidden,
|
||||
cl::aliasopt(MachOOpt));
|
||||
cl::Grouping, cl::aliasopt(MachOOpt));
|
||||
|
||||
cl::opt<std::string>
|
||||
llvm::TripleName("triple", cl::desc("Target triple to disassemble for, "
|
||||
@ -182,7 +186,7 @@ static cl::alias SectionHeadersShort("headers",
|
||||
cl::aliasopt(SectionHeaders));
|
||||
static cl::alias SectionHeadersShorter("h",
|
||||
cl::desc("Alias for --section-headers"),
|
||||
cl::NotHidden,
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(SectionHeaders));
|
||||
|
||||
static cl::opt<bool>
|
||||
@ -213,7 +217,8 @@ cl::opt<bool>
|
||||
llvm::UnwindInfo("unwind-info", cl::desc("Display unwind information"));
|
||||
|
||||
static cl::alias UnwindInfoShort("u", cl::desc("Alias for --unwind-info"),
|
||||
cl::NotHidden, cl::aliasopt(UnwindInfo));
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(UnwindInfo));
|
||||
|
||||
cl::opt<bool>
|
||||
llvm::PrivateHeaders("private-headers",
|
||||
@ -226,7 +231,7 @@ llvm::FirstPrivateHeader("private-header",
|
||||
|
||||
static cl::alias PrivateHeadersShort("p",
|
||||
cl::desc("Alias for --private-headers"),
|
||||
cl::NotHidden,
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(PrivateHeaders));
|
||||
|
||||
cl::opt<bool> llvm::FileHeaders(
|
||||
@ -234,14 +239,16 @@ cl::opt<bool> llvm::FileHeaders(
|
||||
cl::desc("Display the contents of the overall file header"));
|
||||
|
||||
static cl::alias FileHeadersShort("f", cl::desc("Alias for --file-headers"),
|
||||
cl::NotHidden, cl::aliasopt(FileHeaders));
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(FileHeaders));
|
||||
|
||||
cl::opt<bool>
|
||||
llvm::ArchiveHeaders("archive-headers",
|
||||
cl::desc("Display archive header information"));
|
||||
|
||||
cl::alias ArchiveHeadersShort("a", cl::desc("Alias for --archive-headers"),
|
||||
cl::NotHidden, cl::aliasopt(ArchiveHeaders));
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(ArchiveHeaders));
|
||||
|
||||
cl::opt<bool>
|
||||
llvm::PrintImmHex("print-imm-hex",
|
||||
@ -260,14 +267,15 @@ cl::opt<bool> PrintSource(
|
||||
"Display source inlined with disassembly. Implies disassemble object"));
|
||||
|
||||
cl::alias PrintSourceShort("S", cl::desc("Alias for -source"), cl::NotHidden,
|
||||
cl::aliasopt(PrintSource));
|
||||
cl::Grouping, cl::aliasopt(PrintSource));
|
||||
|
||||
cl::opt<bool> PrintLines("line-numbers",
|
||||
cl::desc("Display source line numbers with "
|
||||
"disassembly. Implies disassemble object"));
|
||||
|
||||
cl::alias PrintLinesShort("l", cl::desc("Alias for -line-numbers"),
|
||||
cl::NotHidden, cl::aliasopt(PrintLines));
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(PrintLines));
|
||||
|
||||
cl::opt<unsigned long long>
|
||||
StartAddress("start-address", cl::desc("Disassemble beginning at address"),
|
||||
@ -282,7 +290,7 @@ cl::opt<bool> DisassembleZeroes(
|
||||
cl::desc("Do not skip blocks of zeroes when disassembling"));
|
||||
cl::alias DisassembleZeroesShort("z",
|
||||
cl::desc("Alias for --disassemble-zeroes"),
|
||||
cl::NotHidden,
|
||||
cl::NotHidden, cl::Grouping,
|
||||
cl::aliasopt(DisassembleZeroes));
|
||||
|
||||
static StringRef ToolName;
|
||||
|
Loading…
Reference in New Issue
Block a user