-d code.
Summary:
Move it into `main` function so the checking is effective for all actions
user may do with llvm-objdump; notably, -r and -s in addition to existing -d.
Match GNU behavior.
Reviewers: jhenderson, grimar, MaskRay, rupprecht
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63631
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364118
91177308-0d34-0410-b5e6-
96231b3b80d8
// OUT-OF-RANGE-NOT: Disassembly
-// RUN: not llvm-objdump -d %t.out --start-address=0x40 --stop-address=0x3f 2>&1 | FileCheck %s --check-prefix ERRMSG
-// RUN: not llvm-objdump -d %t.out --start-address=0x40 --stop-address=0x40 2>&1 | FileCheck %s --check-prefix ERRMSG
+// RUN: not llvm-objdump %t.out --start-address=0x40 --stop-address=0x3f 2>&1 | FileCheck %s --check-prefix ERRMSG
+// RUN: not llvm-objdump %t.out --start-address=0x40 --stop-address=0x40 2>&1 | FileCheck %s --check-prefix ERRMSG
// ERRMSG: start address should be less than stop address.
}
static void disassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
- if (StartAddress >= StopAddress)
- error("start address should be less than stop address");
-
const Target *TheTarget = getTarget(Obj);
// Package up features to be passed to target/subtarget
cl::ParseCommandLineOptions(argc, argv, "llvm object file dumper\n");
+ if (StartAddress >= StopAddress)
+ error("start address should be less than stop address");
+
ToolName = argv[0];
// Defaults to a.out if no filenames specified.