Files
TheRock/compiler/amd-llvm/llvm/test/tools/llvm-objdump/section-headers.test
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

173 lines
6.6 KiB
Plaintext

## Test various details of llvm-objdump -h (--section-headers).
## Check leading and trailing whitespace for full lines.
# RUN: yaml2obj %s --docnum=1 -o %t-whitespace.o
# RUN: llvm-objdump -h --show-lma %t-whitespace.o \
# RUN: | FileCheck %s --check-prefix=WHITESPACE --strict-whitespace
# RUN: llvm-objdump -h %t-whitespace.o \
# RUN: | FileCheck %s --check-prefix=WHITESPACE-NO-LMA --strict-whitespace
# WHITESPACE: {{^}}Sections:{{$}}
# WHITESPACE-NEXT: {{^}}Idx Name Size VMA LMA Type{{$}}
# WHITESPACE-NEXT: {{^}} 0 00000000 0000000000000000 0000000000000000 {{$}}
# WHITESPACE-NEXT: {{^}} 1 .text 00000000 0000000000000000 0000000000000000 TEXT{{$}}
# WHITESPACE-NEXT: {{^}} 2 .data 00000000 0000000000000000 0000000000000000 DATA{{$}}
# WHITESPACE-NEXT: {{^}} 3 .bss 00000000 0000000000000000 0000000000000000 BSS{{$}}
# WHITESPACE-NEXT: {{^}} 4 .other 00000000 0000000000000000 0000000000000000 {{$}}
# WHITESPACE-NEXT: {{^}} 5 .debug_abbrev 00000000 0000000000000000 0000000000000000 DEBUG{{$}}
# WHITESPACE-NEXT: {{^}} 6 .debug_info 00000000 0000000000000000 0000000000000000 DATA, DEBUG{{$}}
# WHITESPACE-NEXT: {{^}} 7 .mydata 00000000 0000000000000000 0000000000000000 DATA{{$}}
# WHITESPACE-NEXT: {{^}} 8 .bss1 00000000 0000000000000000 0000000000000000 BSS{{$}}
# WHITESPACE-NEXT: {{^}} 9 .nonalloc.bss 00000000 0000000000000000 0000000000000000 {{$}}
# WHITESPACE-NO-LMA: {{^}}Sections:{{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}}Idx Name Size VMA Type{{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}} 0 00000000 0000000000000000 {{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}} 1 .text 00000000 0000000000000000 TEXT{{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}} 2 .data 00000000 0000000000000000 DATA{{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}} 3 .bss 00000000 0000000000000000 BSS{{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}} 4 .other 00000000 0000000000000000 {{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}} 5 .debug_abbrev 00000000 0000000000000000 DEBUG{{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}} 6 .debug_info 00000000 0000000000000000 DATA, DEBUG{{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}} 7 .mydata 00000000 0000000000000000 DATA{{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}} 8 .bss1 00000000 0000000000000000 BSS{{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}} 9 .nonalloc.bss 00000000 0000000000000000 {{$}}
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [SHF_ALLOC, SHF_EXECINSTR]
- Name: .data
Type: SHT_PROGBITS
Flags: [SHF_ALLOC, SHF_WRITE]
- Name: .bss
Type: SHT_NOBITS
Flags: [SHF_ALLOC, SHF_WRITE]
- Name: .other
Type: SHT_REL
- Name: .debug_abbrev
Type: SHT_PROGBITS
- Name: .debug_info
Type: SHT_PROGBITS
Flags: [ SHF_WRITE, SHF_ALLOC ]
- Name: .mydata
Type: 0x70000000
Flags: [ SHF_ALLOC ]
- Name: .bss1
Type: SHT_NOBITS
Flags: [SHF_ALLOC]
- Name: .nonalloc.bss
Type: SHT_NOBITS
## Check that --section-headers and --headers are aliases for -h.
# RUN: llvm-objdump --section-headers --show-lma %t-whitespace.o \
# RUN: | FileCheck %s --check-prefix=WHITESPACE --strict-whitespace
# RUN: llvm-objdump --headers --show-lma %t-whitespace.o \
# RUN: | FileCheck %s --check-prefix=WHITESPACE --strict-whitespace
## The name field automatically expands past the default 13 columns when a
## section name is longer than that.
## Note: check with and without --show-lma to make sure resizing happens in
## both cases.
# RUN: yaml2obj %s --docnum=2 -o %t-name13chars.o
# RUN: llvm-objdump -h --show-lma %t-name13chars.o \
# RUN: | FileCheck %s --check-prefix=NAME-13 --strict-whitespace
# RUN: llvm-objdump -h %t-name13chars.o \
# RUN: | FileCheck %s --check-prefix=NAME-13 --strict-whitespace
# NAME-13: Sections:
# NAME-13-NEXT: {{^}}Idx Name Size
# NAME-13-NEXT: {{^}} 0 00000000
# NAME-13-NEXT: {{^}} 1 .foo 00000000
# NAME-13-NEXT: {{^}} 2 .thirteenchar 00000000
# NAME-13-NEXT: {{^}} 3 .bar 00000000
## Including a section with a name of length 14 expands the width of the "Name"
## column.
# RUN: yaml2obj %s --docnum=3 -o %t-name14chars.o
# RUN: llvm-objdump -h --show-lma %t-name14chars.o \
# RUN: | FileCheck %s --check-prefix=NAME-14 --strict-whitespace
# RUN: llvm-objdump -h %t-name14chars.o \
# RUN: | FileCheck %s --check-prefix=NAME-14 --strict-whitespace
# NAME-14: Sections:
# NAME-14-NEXT: {{^}}Idx Name Size
# NAME-14-NEXT: {{^}} 0 00000000
# NAME-14-NEXT: {{^}} 1 .foo 00000000
# NAME-14-NEXT: {{^}} 2 .fourteenchars 00000000
# NAME-14-NEXT: {{^}} 3 .bar 00000000
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .foo
Type: SHT_PROGBITS
- Name: .thirteenchar
Type: SHT_PROGBITS
- Name: .bar
Type: SHT_PROGBITS
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .foo
Type: SHT_PROGBITS
- Name: .fourteenchars
Type: SHT_PROGBITS
- Name: .bar
Type: SHT_PROGBITS
## Check that objdump -h only prints the necessary amount of bytes for
## addresses.
# RUN: yaml2obj %s --docnum=4 -D BITS=32 -o %t-32bit.o
# RUN: yaml2obj %s --docnum=4 -D BITS=64 -o %t-64bit.o
# RUN: llvm-objdump -h --show-lma %t-32bit.o \
# RUN: | FileCheck %s --check-prefix=32 --strict-whitespace
# 32: {{^}}Idx Name Size VMA LMA Type{{$}}
# 32: {{^}} 1 .foo 00000000 00000400 00000400 TEXT{{$}}
# RUN: llvm-objdump -h %t-32bit.o \
# RUN: | FileCheck %s --check-prefix=32-NO-LMA --strict-whitespace
# 32-NO-LMA: {{^}}Idx Name Size VMA Type{{$}}
# 32-NO-LMA: {{^}} 1 .foo 00000000 00000400 TEXT{{$}}
# RUN: llvm-objdump -h --show-lma %t-64bit.o \
# RUN: | FileCheck %s --check-prefix=64 --strict-whitespace
# 64: {{^}}Idx Name Size VMA LMA Type{{$}}
# 64: {{^}} 1 .foo 00000000 0000000000000400 0000000000000400 TEXT{{$}}
# RUN: llvm-objdump -h %t-64bit.o \
# RUN: | FileCheck %s --check-prefix=64-NO-LMA --strict-whitespace
# 64-NO-LMA: {{^}}Idx Name Size VMA Type{{$}}
# 64-NO-LMA: {{^}} 1 .foo 00000000 0000000000000400 TEXT{{$}}
--- !ELF
FileHeader:
Class: ELFCLASS[[BITS]]
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_386
Sections:
- Name: .foo
Type: SHT_PROGBITS
Flags: [SHF_ALLOC, SHF_EXECINSTR]
Address: 0x400