Files
TheRock/compiler/amd-llvm/llvm/test/tools/yaml2obj/ELF/header-sh-fields.yaml
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

94 lines
3.0 KiB
YAML

## In this test case we check that we can override the default values for
## ELF header fields in the YAML.
## First we check the default values.
# RUN: yaml2obj %s -o %t-default
# RUN: llvm-readelf --file-headers %t-default | FileCheck %s --check-prefix=DEFAULT
# DEFAULT: Start of program headers: 64 (bytes into file)
# DEFAULT: Start of section headers: 200 (bytes into file)
# DEFAULT: Size of program headers: 56 (bytes)
# DEFAULT: Number of program headers: 2
# DEFAULT: Size of section headers: 64 (bytes)
# DEFAULT: Number of section headers: 3
# DEFAULT: Section header string table index: 2
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
ProgramHeaders:
- Type: PT_LOAD
- Type: PT_LOAD
## Check we can override all default values using the same values
## and that this does not change the output.
# RUN: yaml2obj --docnum=2 %s -o %t-default-override
# RUN: cmp %t-default %t-default-override
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
EShEntSize: [[SHENTSIZE=64]]
EShOff: [[SHOFF=200]]
EShNum: [[SHNUM=3]]
EShStrNdx: [[SHSTRNDX=2]]
EPhOff: [[PHOFF=64]]
EPhEntSize: [[PHENTSIZE=56]]
EPhNum: [[PHNUM=2]]
ProgramHeaders:
- Type: PT_LOAD
- Type: PT_LOAD
## Override different fields to check the output produced.
## Override the e_shoff field.
# RUN: yaml2obj --docnum=2 %s -DSHOFF=3 -o %t2
# RUN: llvm-readelf --file-headers %t2 | FileCheck %s --check-prefix=SHOFF
# SHOFF: Start of section headers: 3 (bytes into file)
## Override the e_shnum field.
# RUN: yaml2obj --docnum=2 %s -DSHNUM=2 -o %t3
# RUN: llvm-readelf --file-headers %t3 | FileCheck %s --check-prefix=SHNUM
# SHNUM: Number of section headers: 2{{$}}
## Override the e_shstrndx field.
# RUN: yaml2obj --docnum=2 %s -DSHSTRNDX=4 -o %t4
# RUN: llvm-readelf --file-headers %t4 | FileCheck %s --check-prefix=SHSTRNDX
# SHSTRNDX: Section header string table index: 4{{$}}
## Override the e_shentsize field.
## Check the result using raw output from 'od' because llvm-readelf
## is unable to dump such headers.
# RUN: yaml2obj --docnum=2 %s -DSHENTSIZE=1 -o %t5
# RUN: od -A n -t x1 -v -j 0x3a -N 1 %t5 | FileCheck %s --check-prefix=NEWSIZE
# RUN: od -A n -t x1 -v -j 0x3a -N 1 %t-default | FileCheck %s --check-prefix=OLDSIZE
# NEWSIZE: 01
# OLDSIZE: 40
## Override the e_phoff field.
# RUN: yaml2obj --docnum=2 %s -DPHOFF=3 -o %t6
# RUN: llvm-readelf --file-headers %t6 | FileCheck %s --check-prefix=PHOFF
# PHOFF: Start of program headers: 3 (bytes into file){{$}}
## Override the e_phnum field.
# RUN: yaml2obj --docnum=2 %s -DPHNUM=1 -o %t7
# RUN: llvm-readelf --file-headers %t7 | FileCheck %s --check-prefix=PHNUM
# PHNUM: Number of program headers: 1{{$}}
## Override the e_phentsize field.
# RUN: yaml2obj --docnum=2 %s -DPHENTSIZE=1 -o %t8
# RUN: llvm-readelf --file-headers %t8 | FileCheck %s --check-prefix=PHENTSIZE
# PHENTSIZE: Size of program headers: 1 (bytes)