Files
TheRock/compiler/amd-llvm/llvm/test/tools/yaml2obj/XCOFF/symbol-section.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

82 lines
2.5 KiB
YAML

## Test the behavior of the symbol reference section.
## Case1: a symbol can reference a section by SectionName or SectionIndex.
# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: llvm-readobj %t1 -s | FileCheck %s --check-prefix=CASE1
# CASE1: Symbols [
# CASE1-NEXT: Symbol {
# CASE1-NEXT: Index: 0
# CASE1-NEXT: Name:
# CASE1-NEXT: Value: 0x0
# CASE1-NEXT: Section: .text
# CASE1-NEXT: Type: 0x0
# CASE1-NEXT: StorageClass: C_NULL (0x0)
# CASE1-NEXT: NumberOfAuxEntries: 0
# CASE1-NEXT: }
# CASE1-NEXT: Symbol {
# CASE1-NEXT: Index: 1
# CASE1-NEXT: Name:
# CASE1-NEXT: Value: 0x0
# CASE1-NEXT: Section: .text
# CASE1-NEXT: Type: 0x0
# CASE1-NEXT: StorageClass: C_NULL (0x0)
# CASE1-NEXT: NumberOfAuxEntries: 0
# CASE1-NEXT: }
# CASE1-NEXT: ]
--- !XCOFF
FileHeader:
MagicNumber: 0x1DF
Sections:
- Name: .text
Symbols:
- Section: .text
- SectionIndex: 1
## Case 2: a symbol can reference a section by both SectionName and SectionIndex.
# RUN: yaml2obj --docnum=2 -DSECNAME='.text' -DSECINDEX=1 %s -o %t2
# RUN: llvm-readobj %t2 -s | FileCheck %s --check-prefix=CASE2
# CASE2: Symbols [
# CASE2-NEXT: Symbol {
# CASE2-NEXT: Index: 0
# CASE2-NEXT: Name:
# CASE2-NEXT: Value: 0x0
# CASE2-NEXT: Section: .text
# CASE2-NEXT: Type: 0x0
# CASE2-NEXT: StorageClass: C_NULL (0x0)
# CASE2-NEXT: NumberOfAuxEntries: 0
# CASE2-NEXT: }
# CASE2-NEXT: ]
--- !XCOFF
FileHeader:
MagicNumber: 0x1DF
Sections:
- Name: .text
Symbols:
- Section: [[SECNAME=<none>]]
SectionIndex: [[SECINDEX=<none>]]
## Case3: if both Section and SectionIndex are specified, but the two
## values refer to different sections, an error will be reported.
# RUN: not yaml2obj --docnum=2 -DSECNAME='.text' -DSECINDEX=0 %s -o %t3 2>&1 \
# RUN: | FileCheck %s --check-prefix=CASE3
# CASE3: the SectionName .text and the SectionIndex (0) refer to different sections
## Case4: yaml2obj allows the specification of an invalid SectionIndex.
## TODO: the error message should include the symbol name or index.
# RUN: yaml2obj --docnum=2 -DSECINDEX=2 %s -o %t4
# RUN: not llvm-readobj %t4 -s 2>&1 | FileCheck %s --check-prefix=CASE4
# CASE4: the section index (2) is invalid
## Case 5: if a symbol references a non-existent section by SectionName,
## an error will be reported.
# RUN: not yaml2obj --docnum=2 -DSECNAME='.data' %s -o %t5 2>&1 \
# RUN: | FileCheck %s --check-prefix=CASE5
# CASE5: the SectionName .data specified in the symbol does not exist