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 {{$}}
19 # WHITESPACE-NO-LMA: {{^}}Sections:{{$}}
20 # WHITESPACE-NO-LMA-NEXT: {{^}}Idx Name Size VMA Type{{$}}
21 # WHITESPACE-NO-LMA-NEXT: {{^}} 0 00000000 0000000000000000 {{$}}
22 # WHITESPACE-NO-LMA-NEXT: {{^}} 1 .text 00000000 0000000000000000 TEXT{{$}}
23 # WHITESPACE-NO-LMA-NEXT: {{^}} 2 .data 00000000 0000000000000000 DATA{{$}}
24 # WHITESPACE-NO-LMA-NEXT: {{^}} 3 .bss 00000000 0000000000000000 BSS{{$}}
25 # WHITESPACE-NO-LMA-NEXT: {{^}} 4 .other 00000000 0000000000000000 {{$}}
36 Flags: [SHF_ALLOC, SHF_EXECINSTR]
39 Flags: [SHF_ALLOC, SHF_WRITE]
42 Flags: [SHF_ALLOC, SHF_WRITE]
46 ## The name field automatically expands past the default 13 columns when a
47 ## section name is longer than that.
48 ## Note: check with and without --show-lma to make sure resizing happens in
51 # RUN: yaml2obj %s --docnum=2 -o %t-name13chars.o
52 # RUN: llvm-objdump -h --show-lma %t-name13chars.o \
53 # RUN: | FileCheck %s --check-prefix=NAME-13 --strict-whitespace
54 # RUN: llvm-objdump -h %t-name13chars.o \
55 # RUN: | FileCheck %s --check-prefix=NAME-13 --strict-whitespace
58 # NAME-13-NEXT: {{^}}Idx Name Size
59 # NAME-13-NEXT: {{^}} 0 00000000
60 # NAME-13-NEXT: {{^}} 1 .foo 00000000
61 # NAME-13-NEXT: {{^}} 2 .thirteenchar 00000000
62 # NAME-13-NEXT: {{^}} 3 .bar 00000000
64 ## Including a section with a name of length 14 expands the width of the "Name"
66 # RUN: yaml2obj %s --docnum=3 -o %t-name14chars.o
67 # RUN: llvm-objdump -h --show-lma %t-name14chars.o \
68 # RUN: | FileCheck %s --check-prefix=NAME-14 --strict-whitespace
69 # RUN: llvm-objdump -h %t-name14chars.o \
70 # RUN: | FileCheck %s --check-prefix=NAME-14 --strict-whitespace
73 # NAME-14-NEXT: {{^}}Idx Name Size
74 # NAME-14-NEXT: {{^}} 0 00000000
75 # NAME-14-NEXT: {{^}} 1 .foo 00000000
76 # NAME-14-NEXT: {{^}} 2 .fourteenchars 00000000
77 # NAME-14-NEXT: {{^}} 3 .bar 00000000
102 - Name: .fourteenchars
107 ## Check that objdump -h only prints the necessary amount of bytes for
110 # RUN: yaml2obj %s --docnum=4 -o %t-32bit.o
111 # RUN: yaml2obj %s --docnum=5 -o %t-64bit.o
113 # RUN: llvm-objdump -h --show-lma %t-32bit.o \
114 # RUN: | FileCheck %s --check-prefix=32 --strict-whitespace
115 # 32: {{^}}Idx Name Size VMA LMA Type{{$}}
116 # 32: {{^}} 1 .foo 00000000 00000400 00000400 TEXT{{$}}
118 # RUN: llvm-objdump -h %t-32bit.o \
119 # RUN: | FileCheck %s --check-prefix=32-NO-LMA --strict-whitespace
120 # 32-NO-LMA: {{^}}Idx Name Size VMA Type{{$}}
121 # 32-NO-LMA: {{^}} 1 .foo 00000000 00000400 TEXT{{$}}
123 # RUN: llvm-objdump -h --show-lma %t-64bit.o \
124 # RUN: | FileCheck %s --check-prefix=64 --strict-whitespace
125 # 64: {{^}}Idx Name Size VMA LMA Type{{$}}
126 # 64: {{^}} 1 .foo 00000000 0000000000000400 0000000000000400 TEXT{{$}}
128 # RUN: llvm-objdump -h %t-64bit.o \
129 # RUN: | FileCheck %s --check-prefix=64-NO-LMA --strict-whitespace
130 # 64-NO-LMA: {{^}}Idx Name Size VMA Type{{$}}
131 # 64-NO-LMA: {{^}} 1 .foo 00000000 0000000000000400 TEXT{{$}}
142 Flags: [SHF_ALLOC, SHF_EXECINSTR]
154 Flags: [SHF_ALLOC, SHF_EXECINSTR]