summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-readobj/hexdump.test
blob: 0cae679aa2c3ff0eb0b30b8a3892d77308c3934d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Check dumping of the hexadecimal bytes of a section.
RUN: llvm-readobj -x .text %p/../../Object/Inputs/hello-world.elf-x86-64 | FileCheck %s

CHECK: Hex dump of section '.text':
CHECK-NEXT: {{^}}0x00400460

// Test that the -x alias can be used flexibly. Create a baseline and ensure
// all other combinations are identical.
RUN: llvm-readelf --file-header --hex-dump=.text \
RUN:   %p/../../Object/Inputs/hello-world.elf-x86-64 > %t.hexdump.out
RUN: llvm-readelf -h --hex-dump .text \
RUN:   %p/../../Object/Inputs/hello-world.elf-x86-64 > %t.hexdump.1
RUN: llvm-readelf -h -x .text \
RUN:   %p/../../Object/Inputs/hello-world.elf-x86-64 > %t.hexdump.2
RUN: llvm-readelf -h -x=.text \
RUN:   %p/../../Object/Inputs/hello-world.elf-x86-64 > %t.hexdump.3
RUN: llvm-readelf -h -x.text \
RUN:   %p/../../Object/Inputs/hello-world.elf-x86-64 > %t.hexdump.4
RUN: llvm-readelf -hx .text \
RUN:   %p/../../Object/Inputs/hello-world.elf-x86-64 > %t.hexdump.5
RUN: llvm-readelf -hx=.text \
RUN:   %p/../../Object/Inputs/hello-world.elf-x86-64 > %t.hexdump.6
RUN: llvm-readelf -hx.text \
RUN:   %p/../../Object/Inputs/hello-world.elf-x86-64 > %t.hexdump.7

RUN: cmp %t.hexdump.out %t.hexdump.1
RUN: cmp %t.hexdump.out %t.hexdump.2
RUN: cmp %t.hexdump.out %t.hexdump.3
RUN: cmp %t.hexdump.out %t.hexdump.4
RUN: cmp %t.hexdump.out %t.hexdump.5
RUN: cmp %t.hexdump.out %t.hexdump.6
RUN: cmp %t.hexdump.out %t.hexdump.7
OpenPOWER on IntegriCloud