1 ## Test various details of llvm-objdump -h (--section-headers).
3 ## Check leading and trailing whitespace for full lines.
5 # RUN: yaml2obj %s --docnum=1 -o %t-whitespace.o
6 # RUN: llvm-objdump -h --show-lma %t-whitespace.o \
7 # RUN: | FileCheck %s --check-prefix=WHITESPACE --strict-whitespace
8 # RUN: llvm-objdump -h %t-whitespace.o \
9 # RUN: | FileCheck %s --check-prefix=WHITESPACE-NO-LMA --strict-whitespace
11 # WHITESPACE: {{^}}Sections:{{$}}
12 # WHITESPACE-NEXT: {{^}}Idx Name Size VMA LMA Type{{$}}
13 # WHITESPACE-NEXT: {{^}} 0 00000000 0000000000000000 0000000000000000 {{$}}
14 # WHITESPACE-NEXT: {{^}} 1 .text 00000000 0000000000000000 0000000000000000 TEXT{{$}}
15 # WHITESPACE-NEXT: {{^}} 2 .data 00000000 0000000000000000 0000000000000000 DATA{{$}}
16 # WHITESPACE-NEXT: {{^}} 3 .bss 00000000 0000000000000000 0000000000000000 BSS{{$}}
17 # WHITESPACE-NEXT: {{^}} 4 .other 00000000 0000000000000000 0000000000000000 {{$}}
18 # WHITESPACE-NEXT: {{^}} 5 .debug_abbrev 00000000 0000000000000000 0000000000000000 DEBUG{{$}}
19 # WHITESPACE-NEXT: {{^}} 6 .debug_info 00000000 0000000000000000 0000000000000000 DATA, DEBUG{{$}}
21 # WHITESPACE-NO-LMA: {{^}}Sections:{{$}}
22 # WHITESPACE-NO-LMA-NEXT: {{^}}Idx Name Size VMA Type{{$}}
23 # WHITESPACE-NO-LMA-NEXT: {{^}} 0 00000000 0000000000000000 {{$}}
24 # WHITESPACE-NO-LMA-NEXT: {{^}} 1 .text 00000000 0000000000000000 TEXT{{$}}
25 # WHITESPACE-NO-LMA-NEXT: {{^}} 2 .data 00000000 0000000000000000 DATA{{$}}
26 # WHITESPACE-NO-LMA-NEXT: {{^}} 3 .bss 00000000 0000000000000000 BSS{{$}}
27 # WHITESPACE-NO-LMA-NEXT: {{^}} 4 .other 00000000 0000000000000000 {{$}}
28 # WHITESPACE-NO-LMA-NEXT: {{^}} 5 .debug_abbrev 00000000 0000000000000000 DEBUG{{$}}
29 # WHITESPACE-NO-LMA-NEXT: {{^}} 6 .debug_info 00000000 0000000000000000 DATA, DEBUG{{$}}
40 Flags: [SHF_ALLOC, SHF_EXECINSTR]
43 Flags: [SHF_ALLOC, SHF_WRITE]
46 Flags: [SHF_ALLOC, SHF_WRITE]
53 Flags: [ SHF_WRITE, SHF_ALLOC ]
55 ## Check that --section-headers and --headers are aliases for -h.
56 # RUN: llvm-objdump --section-headers --show-lma %t-whitespace.o \
57 # RUN: | FileCheck %s --check-prefix=WHITESPACE --strict-whitespace
58 # RUN: llvm-objdump --headers --show-lma %t-whitespace.o \
59 # RUN: | FileCheck %s --check-prefix=WHITESPACE --strict-whitespace
61 ## The name field automatically expands past the default 13 columns when a
62 ## section name is longer than that.
63 ## Note: check with and without --show-lma to make sure resizing happens in
66 # RUN: yaml2obj %s --docnum=2 -o %t-name13chars.o
67 # RUN: llvm-objdump -h --show-lma %t-name13chars.o \
68 # RUN: | FileCheck %s --check-prefix=NAME-13 --strict-whitespace
69 # RUN: llvm-objdump -h %t-name13chars.o \
70 # RUN: | FileCheck %s --check-prefix=NAME-13 --strict-whitespace
73 # NAME-13-NEXT: {{^}}Idx Name Size
74 # NAME-13-NEXT: {{^}} 0 00000000
75 # NAME-13-NEXT: {{^}} 1 .foo 00000000
76 # NAME-13-NEXT: {{^}} 2 .thirteenchar 00000000
77 # NAME-13-NEXT: {{^}} 3 .bar 00000000
79 ## Including a section with a name of length 14 expands the width of the "Name"
81 # RUN: yaml2obj %s --docnum=3 -o %t-name14chars.o
82 # RUN: llvm-objdump -h --show-lma %t-name14chars.o \
83 # RUN: | FileCheck %s --check-prefix=NAME-14 --strict-whitespace
84 # RUN: llvm-objdump -h %t-name14chars.o \
85 # RUN: | FileCheck %s --check-prefix=NAME-14 --strict-whitespace
88 # NAME-14-NEXT: {{^}}Idx Name Size
89 # NAME-14-NEXT: {{^}} 0 00000000
90 # NAME-14-NEXT: {{^}} 1 .foo 00000000
91 # NAME-14-NEXT: {{^}} 2 .fourteenchars 00000000
92 # NAME-14-NEXT: {{^}} 3 .bar 00000000
103 - Name: .thirteenchar
117 - Name: .fourteenchars
122 ## Check that objdump -h only prints the necessary amount of bytes for
125 # RUN: yaml2obj %s --docnum=4 -D BITS=32 -o %t-32bit.o
126 # RUN: yaml2obj %s --docnum=4 -D BITS=64 -o %t-64bit.o
128 # RUN: llvm-objdump -h --show-lma %t-32bit.o \
129 # RUN: | FileCheck %s --check-prefix=32 --strict-whitespace
130 # 32: {{^}}Idx Name Size VMA LMA Type{{$}}
131 # 32: {{^}} 1 .foo 00000000 00000400 00000400 TEXT{{$}}
133 # RUN: llvm-objdump -h %t-32bit.o \
134 # RUN: | FileCheck %s --check-prefix=32-NO-LMA --strict-whitespace
135 # 32-NO-LMA: {{^}}Idx Name Size VMA Type{{$}}
136 # 32-NO-LMA: {{^}} 1 .foo 00000000 00000400 TEXT{{$}}
138 # RUN: llvm-objdump -h --show-lma %t-64bit.o \
139 # RUN: | FileCheck %s --check-prefix=64 --strict-whitespace
140 # 64: {{^}}Idx Name Size VMA LMA Type{{$}}
141 # 64: {{^}} 1 .foo 00000000 0000000000000400 0000000000000400 TEXT{{$}}
143 # RUN: llvm-objdump -h %t-64bit.o \
144 # RUN: | FileCheck %s --check-prefix=64-NO-LMA --strict-whitespace
145 # 64-NO-LMA: {{^}}Idx Name Size VMA Type{{$}}
146 # 64-NO-LMA: {{^}} 1 .foo 00000000 0000000000000400 TEXT{{$}}
150 Class: ELFCLASS[[BITS]]
157 Flags: [SHF_ALLOC, SHF_EXECINSTR]