Files
TheRock/compiler/amd-llvm/llvm/test/tools/llvm-readobj/ELF/RISCV/attributes-invalid.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

77 lines
3.3 KiB
Plaintext

## Check how we dump invalid SHT_RISCV_ATTRIBUTES sections.
## This test case is used to ensure llvm-readobj checks the version of
## attribute sections correctly. The only supported format is 'A' (41),
## here we use 'B' (42).
# RUN: yaml2obj %s -D BITS=32 -DCONTENT=42 -o %t1.32.o
# RUN: llvm-readobj -A %t1.32.o 2>&1 | \
# RUN: FileCheck -DFILE=%t1 %s --implicit-check-not=warning: --check-prefix=ERR-FORMAT
# RUN: yaml2obj %s -D BITS=64 -DCONTENT=42 -o %t1.64.o
# RUN: llvm-readobj -A %t1.64.o 2>&1 | \
# RUN: FileCheck -DFILE=%t1 %s --implicit-check-not=warning: --check-prefix=ERR-FORMAT
# ERR-FORMAT: BuildAttributes {
# ERR-FORMAT-NEXT: FormatVersion: 0x42
# ERR-FORMAT-NEXT: warning: '[[FILE]].{{32|64}}.o': unable to dump attributes from the SHT_RISCV_ATTRIBUTES section with index 1: unrecognized format-version: 0x42
# ERR-FORMAT-NEXT: }
--- !ELF
FileHeader:
Class: ELFCLASS[[BITS=64]]
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_RISCV
Sections:
- Name: .riscv.attributes
Type: SHT_RISCV_ATTRIBUTES
Content: [[CONTENT]]
ShOffset: [[SHOFFSET=<none>]]
## Check we report a warning when we are unable to parse the attribute section data.
## FIXME: this test case documents that we don't close the "Section X" clause of
## the output properly when a warning is reported by the attributes parser.
# RUN: yaml2obj %s -D BITS=32 -DCONTENT=4100000000 -o %t2.32.o
# RUN: llvm-readobj -A %t2.32.o 2>&1 | \
# RUN: FileCheck -DFILE=%t2 %s --implicit-check-not=warning: --check-prefix=ERR-LENGTH
# RUN: yaml2obj %s -D BITS=64 -DCONTENT=4100000000 -o %t2.64.o
# RUN: llvm-readobj -A %t2.64.o 2>&1 | \
# RUN: FileCheck -DFILE=%t2 %s --implicit-check-not=warning: --check-prefix=ERR-LENGTH
# ERR-LENGTH: BuildAttributes {
# ERR-LENGTH-NEXT: FormatVersion: 0x41
# ERR-LENGTH-NEXT: Section 1 {
# ERR-LENGTH-NEXT: warning: '[[FILE]].{{32|64}}.o': unable to dump attributes from the SHT_RISCV_ATTRIBUTES section with index 1: invalid section length 0 at offset 0x1
# ERR-LENGTH-NEXT: }
# ERR-LENGTH-NOT: {{.}}
## Check that we don't report a warning when the SHT_RISCV_ATTRIBUTES section contains the
## valid format version byte and no other data.
# RUN: yaml2obj %s -DCONTENT=41 -o %t3.o
# RUN: llvm-readobj -A %t3.o 2>&1 | \
# RUN: FileCheck %s --implicit-check-not=warning: --check-prefix=NO-CONTENT
# NO-CONTENT: BuildAttributes {
# NO-CONTENT-NEXT: FormatVersion: 0x41
# NO-CONTENT-NEXT: }
## Check we report a warning when we are unable to read the content of the SHT_RISCV_ATTRIBUTES section.
# RUN: yaml2obj %s -DCONTENT="''" -DSHOFFSET=0xffffffff -o %t4.o
# RUN: llvm-readobj -A %t4.o 2>&1 | \
# RUN: FileCheck %s -DFILE=%t4.o --implicit-check-not=warning: --check-prefix=BROKEN-CONTENT
# BROKEN-CONTENT: BuildAttributes {
# BROKEN-CONTENT-NEXT: warning: '[[FILE]]': unable to read the content of the SHT_RISCV_ATTRIBUTES section with index 1: section [index 1] has a sh_offset (0xffffffff) + sh_size (0x0) that is greater than the file size (0x168)
# BROKEN-CONTENT-NEXT: }
# RUN: yaml2obj %s -DCONTENT="''" -o %t5.o
# RUN: llvm-readobj -A %t5.o 2>&1 | \
# RUN: FileCheck %s -DFILE=%t5.o --implicit-check-not=warning: --check-prefix=EMPTY-CONTENT
# EMPTY-CONTENT: BuildAttributes {
# EMPTY-CONTENT-NEXT: warning: '[[FILE]]': the SHT_RISCV_ATTRIBUTES section with index 1 is empty
# EMPTY-CONTENT-NEXT: }