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{{$}}
20 # WHITESPACE-NEXT: {{^}} 7 .mydata 00000000 0000000000000000 0000000000000000 DATA{{$}}
21 # WHITESPACE-NEXT: {{^}} 8 .bss1 00000000 0000000000000000 0000000000000000 BSS{{$}}
22 # WHITESPACE-NEXT: {{^}} 9 .nonalloc.bss 00000000 0000000000000000 0000000000000000 {{$}}
24 # WHITESPACE-NO-LMA: {{^}}Sections:{{$}}
25 # WHITESPACE-NO-LMA-NEXT: {{^}}Idx Name Size VMA Type{{$}}
26 # WHITESPACE-NO-LMA-NEXT: {{^}} 0 00000000 0000000000000000 {{$}}
27 # WHITESPACE-NO-LMA-NEXT: {{^}} 1 .text 00000000 0000000000000000 TEXT{{$}}
28 # WHITESPACE-NO-LMA-NEXT: {{^}} 2 .data 00000000 0000000000000000 DATA{{$}}
29 # WHITESPACE-NO-LMA-NEXT: {{^}} 3 .bss 00000000 0000000000000000 BSS{{$}}
30 # WHITESPACE-NO-LMA-NEXT: {{^}} 4 .other 00000000 0000000000000000 {{$}}
31 # WHITESPACE-NO-LMA-NEXT: {{^}} 5 .debug_abbrev 00000000 0000000000000000 DEBUG{{$}}
32 # WHITESPACE-NO-LMA-NEXT: {{^}} 6 .debug_info 00000000 0000000000000000 DATA, DEBUG{{$}}
33 # WHITESPACE-NO-LMA-NEXT: {{^}} 7 .mydata 00000000 0000000000000000 DATA{{$}}
34 # WHITESPACE-NO-LMA-NEXT: {{^}} 8 .bss1 00000000 0000000000000000 BSS{{$}}
35 # WHITESPACE-NO-LMA-NEXT: {{^}} 9 .nonalloc.bss 00000000 0000000000000000 {{$}}
46 Flags: [SHF_ALLOC, SHF_EXECINSTR]
49 Flags: [SHF_ALLOC, SHF_WRITE]
52 Flags: [SHF_ALLOC, SHF_WRITE]
59 Flags: [ SHF_WRITE, SHF_ALLOC ]
69 ## Check that --section-headers and --headers are aliases for -h.
70 # RUN: llvm-objdump --section-headers --show-lma %t-whitespace.o \
71 # RUN: | FileCheck %s --check-prefix=WHITESPACE --strict-whitespace
72 # RUN: llvm-objdump --headers --show-lma %t-whitespace.o \
73 # RUN: | FileCheck %s --check-prefix=WHITESPACE --strict-whitespace
75 ## The name field automatically expands past the default 13 columns when a
76 ## section name is longer than that.
77 ## Note: check with and without --show-lma to make sure resizing happens in
80 # RUN: yaml2obj %s --docnum=2 -o %t-name13chars.o
81 # RUN: llvm-objdump -h --show-lma %t-name13chars.o \
82 # RUN: | FileCheck %s --check-prefix=NAME-13 --strict-whitespace
83 # RUN: llvm-objdump -h %t-name13chars.o \
84 # RUN: | FileCheck %s --check-prefix=NAME-13 --strict-whitespace
87 # NAME-13-NEXT: {{^}}Idx Name Size
88 # NAME-13-NEXT: {{^}} 0 00000000
89 # NAME-13-NEXT: {{^}} 1 .foo 00000000
90 # NAME-13-NEXT: {{^}} 2 .thirteenchar 00000000
91 # NAME-13-NEXT: {{^}} 3 .bar 00000000
93 ## Including a section with a name of length 14 expands the width of the "Name"
95 # RUN: yaml2obj %s --docnum=3 -o %t-name14chars.o
96 # RUN: llvm-objdump -h --show-lma %t-name14chars.o \
97 # RUN: | FileCheck %s --check-prefix=NAME-14 --strict-whitespace
98 # RUN: llvm-objdump -h %t-name14chars.o \
99 # RUN: | FileCheck %s --check-prefix=NAME-14 --strict-whitespace
102 # NAME-14-NEXT: {{^}}Idx Name Size
103 # NAME-14-NEXT: {{^}} 0 00000000
104 # NAME-14-NEXT: {{^}} 1 .foo 00000000
105 # NAME-14-NEXT: {{^}} 2 .fourteenchars 00000000
106 # NAME-14-NEXT: {{^}} 3 .bar 00000000
117 - Name: .thirteenchar
131 - Name: .fourteenchars
136 ## Check that objdump -h only prints the necessary amount of bytes for
139 # RUN: yaml2obj %s --docnum=4 -D BITS=32 -o %t-32bit.o
140 # RUN: yaml2obj %s --docnum=4 -D BITS=64 -o %t-64bit.o
142 # RUN: llvm-objdump -h --show-lma %t-32bit.o \
143 # RUN: | FileCheck %s --check-prefix=32 --strict-whitespace
144 # 32: {{^}}Idx Name Size VMA LMA Type{{$}}
145 # 32: {{^}} 1 .foo 00000000 00000400 00000400 TEXT{{$}}
147 # RUN: llvm-objdump -h %t-32bit.o \
148 # RUN: | FileCheck %s --check-prefix=32-NO-LMA --strict-whitespace
149 # 32-NO-LMA: {{^}}Idx Name Size VMA Type{{$}}
150 # 32-NO-LMA: {{^}} 1 .foo 00000000 00000400 TEXT{{$}}
152 # RUN: llvm-objdump -h --show-lma %t-64bit.o \
153 # RUN: | FileCheck %s --check-prefix=64 --strict-whitespace
154 # 64: {{^}}Idx Name Size VMA LMA Type{{$}}
155 # 64: {{^}} 1 .foo 00000000 0000000000000400 0000000000000400 TEXT{{$}}
157 # RUN: llvm-objdump -h %t-64bit.o \
158 # RUN: | FileCheck %s --check-prefix=64-NO-LMA --strict-whitespace
159 # 64-NO-LMA: {{^}}Idx Name Size VMA Type{{$}}
160 # 64-NO-LMA: {{^}} 1 .foo 00000000 0000000000000400 TEXT{{$}}
164 Class: ELFCLASS[[BITS]]
171 Flags: [SHF_ALLOC, SHF_EXECINSTR]