Files
TheRock/compiler/amd-llvm/llvm/test/tools/llvm-ar/big-archive-xcoff-align.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

110 lines
4.2 KiB
Plaintext

## Test the alignment of XCOFF object files in the big archive format.
# RUN: rm -rf %t && mkdir %t
# RUN: cd %t
# RUN: yaml2obj --docnum=1 -DFLAG=0x1DF -DSECNAME=.data %s -o t32_1.o
# RUN: yaml2obj --docnum=1 -DFLAG=0x1F7 -DSECNAME=.data %s -o t64_1.o
# RUN: yaml2obj --docnum=1 -DFLAG=0x1DF -DSECNAME=.text %s -o t32_2.o
# RUN: yaml2obj --docnum=1 -DFLAG=0x1F7 -DSECNAME=.text %s -o t64_2.o
# RUN: yaml2obj --docnum=2 -DFLAG=0x1DF %s -o t32_nomaxdata_text.o
# RUN: yaml2obj --docnum=2 -DFLAG=0x1F7 %s -o t64_nomaxdata_text.o
# RUN: yaml2obj --docnum=3 -DFLAG=0x1DF %s -o t32_maxdata_text.o
# RUN: yaml2obj --docnum=3 -DFLAG=0x1F7 %s -o t64_maxdata_text.o
# RUN: yaml2obj --docnum=4 -DFLAG=0x1DF %s -o t32_noloader.o
# RUN: yaml2obj --docnum=4 -DFLAG=0x1F7 %s -o t64_noloader.o
# RUN: yaml2obj --docnum=5 -DFLAG=0x1DF %s -o t32_excess.o
# RUN: yaml2obj --docnum=5 -DFLAG=0x1F7 %s -o t64_excess.o
# RUN: echo -e "import sys\nf=open(sys.argv[1],\"rb\");f.seek(int(sys.argv[2]));print(f.read(2));f.close()" > print_magic.py
## Test that the content of an XCOFF object file, which has an auxiliary header,
## is aligned in a big archive based on the content of auxiliary header.
# RUN: env OBJECT_MODE=32_64 llvm-ar -q t_aux.a t32_nomaxdata_text.o t64_nomaxdata_text.o t32_maxdata_text.o t64_maxdata_text.o t32_noloader.o t64_noloader.o t32_excess.o t64_excess.o
## The content of t32_nomaxdata_text, t64_nomaxdata_text.o aligned at 2.
# RUN: %python print_magic.py t_aux.a 262 | FileCheck --check-prefix=MAGIC32 %s
# RUN: %python print_magic.py t_aux.a 528 | FileCheck --check-prefix=MAGIC64 %s
## The content of t32_maxdata_text.o, t64_maxdata_text.o aligned at 2^8.
# RUN: %python print_magic.py t_aux.a 1024 | FileCheck --check-prefix=MAGIC32 %s
# RUN: %python print_magic.py t_aux.a 1536 | FileCheck --check-prefix=MAGIC64 %s
## The content of t32_noloader.o, t64_noloader.o aligned at 2.
# RUN: %python print_magic.py t_aux.a 1870 | FileCheck --check-prefix=MAGIC32 %s
# RUN: %python print_magic.py t_aux.a 2130 | FileCheck --check-prefix=MAGIC64 %s
## The content of t32_excess.o aligned at word.
# RUN: %python print_magic.py t_aux.a 2464 | FileCheck --check-prefix=MAGIC32 %s
## The content of t64_excess.o aligned at 2^12.
# RUN: %python print_magic.py t_aux.a 4096 | FileCheck --check-prefix=MAGIC64 %s
## Test that the content of an XCOFF object file, which does not have an auxiliary
## header, is aligned at 2 in a big archive.
# RUN: env OBJECT_MODE=32_64 llvm-ar -q t3.a t32_1.o t64_1.o t32_2.o t64_2.o
# # RUN: %python print_magic.py t3.a 250 | FileCheck --check-prefix=MAGIC32 %s
# # RUN: %python print_magic.py t3.a 432 | FileCheck -check-prefix=MAGIC64 %s
# # RUN: %python print_magic.py t3.a 650 | FileCheck --check-prefix=MAGIC32 %s
# # RUN: %python print_magic.py t3.a 832 | FileCheck -check-prefix=MAGIC64 %s
# MAGIC64: b'\x01\xf7'
# MAGIC32: b'\x01\xdf'
--- !XCOFF
FileHeader:
MagicNumber: [[FLAG]]
Sections:
- Name: [[SECNAME]]
Flags: [ STYP_DATA ]
## The auxiliary header has neither the MaxAlignOfData nor MaxAlignOfText field.
--- !XCOFF
FileHeader:
MagicNumber: [[FLAG]]
AuxiliaryHeaderSize: 12
AuxiliaryHeader:
Magic: 0x10B
SecNumOfLoader: 1
Sections:
- Name: .text
Flags: [ STYP_DATA ]
## The auxiliary header has both MaxAlignOfData and MaxAlignOfText fields.
--- !XCOFF
FileHeader:
MagicNumber: [[FLAG]]
AuxiliaryHeaderSize: 48
AuxiliaryHeader:
Magic: 0x10B
SecNumOfLoader: 1
MaxAlignOfText: 6
MaxAlignOfData: 8
Sections:
- Name: .text
Flags: [ STYP_DATA ]
## The auxiliary header does not have a loader section.
--- !XCOFF
FileHeader:
MagicNumber: [[FLAG]]
AuxiliaryHeaderSize: 34
AuxiliaryHeader:
Magic: 0x10B
SecNumOfLoader: 0
MaxAlignOfText: 14
MaxAlignOfData: 8
Sections:
- Name: .text
Flags: [ STYP_DATA ]
## The auxiliary header has both MaxAlignOfData and MaxAlignOfText fields
## but max(MaxAlignOfData, MaxAlignOfText) exceeds the page size(2^12).
--- !XCOFF
FileHeader:
MagicNumber: [[FLAG]]
AuxiliaryHeaderSize: 48
AuxiliaryHeader:
Magic: 0x10B
SecNumOfLoader: 1
MaxAlignOfText: 14
MaxAlignOfData: 8
Sections:
- Name: .text
Flags: [ STYP_DATA ]