Files
TheRock/compiler/amd-llvm/llvm/test/MC/LoongArch/Relocations/sub-expr.s
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

84 lines
2.6 KiB
ArmAsm

# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=-relax %s \
# RUN: | llvm-readobj -r - | FileCheck %s --check-prefixes=CHECK,NORELAX
# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=+relax %s \
# RUN: | llvm-readobj -r - | FileCheck %s --check-prefixes=CHECK,RELAX
## Check that subtraction expressions emit R_LARCH_32_PCREL and R_LARCH_64_PCREL relocations.
## TODO: 1- or 2-byte data relocations are not supported for now.
# CHECK: Relocations [
# NORELAX-NEXT: Section ({{.*}}) .rela.sx {
# NORELAX-NEXT: 0x4 R_LARCH_PCALA_HI20 z 0x0
# NORELAX-NEXT: 0x8 R_LARCH_PCALA_LO12 z 0x0
# NORELAX-NEXT: 0xC R_LARCH_32_PCREL y 0x8
# NORELAX-NEXT: }
# RELAX-NEXT: Section ({{.*}}) .rela.sx {
# RELAX-NEXT: 0x4 R_LARCH_PCALA_HI20 z 0x0
# RELAX-NEXT: 0x4 R_LARCH_RELAX - 0x0
# RELAX-NEXT: 0x8 R_LARCH_PCALA_LO12 z 0x0
# RELAX-NEXT: 0x8 R_LARCH_RELAX - 0x0
# RELAX-NEXT: 0xC R_LARCH_ADD32 y 0x0
# RELAX-NEXT: 0xC R_LARCH_SUB32 x 0x0
# RELAX-NEXT: }
# CHECK-NEXT: Section ({{.*}}) .rela.data {
# CHECK-NEXT: 0x0 R_LARCH_64_PCREL x 0x0
# CHECK-NEXT: 0x8 R_LARCH_64_PCREL y 0x0
# CHECK-NEXT: 0x10 R_LARCH_32_PCREL x 0x0
# CHECK-NEXT: 0x14 R_LARCH_32_PCREL y 0x0
# CHECK-NEXT: 0x18 R_LARCH_ADD64 x 0x0
# CHECK-NEXT: 0x18 R_LARCH_SUB64 y 0x0
# CHECK-NEXT: 0x20 R_LARCH_ADD64 y 0x0
# CHECK-NEXT: 0x20 R_LARCH_SUB64 x 0x0
# CHECK-NEXT: 0x28 R_LARCH_ADD32 x 0x0
# CHECK-NEXT: 0x28 R_LARCH_SUB32 y 0x0
# CHECK-NEXT: 0x2C R_LARCH_ADD32 y 0x0
# CHECK-NEXT: 0x2C R_LARCH_SUB32 x 0x0
# CHECK-NEXT: 0x30 R_LARCH_ADD64 {{.*}} 0x0
# CHECK-NEXT: 0x30 R_LARCH_SUB64 x 0x0
# CHECK-NEXT: 0x38 R_LARCH_ADD32 {{.*}} 0x0
# CHECK-NEXT: 0x38 R_LARCH_SUB32 y 0x0
# CHECK-NEXT: 0x3C R_LARCH_32_PCREL - 0xBEEF
# CHECK-NEXT: 0x40 R_LARCH_64_PCREL - 0xBEEF
# CHECK-NEXT: }
# NORELAX-NEXT: Section ({{.*}}) .rela.sy {
# NORELAX-NEXT: 0x0 R_LARCH_CALL36 foo 0x0
# NORELAX-NEXT: 0x10 R_LARCH_32_PCREL x 0x8
# NORELAX-NEXT: }
# RELAX-NEXT: Section ({{.*}}) .rela.sy {
# RELAX-NEXT: 0x0 R_LARCH_CALL36 foo 0x0
# RELAX-NEXT: 0x0 R_LARCH_RELAX - 0x0
# RELAX-NEXT: 0x8 R_LARCH_ALIGN - 0xC
# RELAX-NEXT: 0x14 R_LARCH_ADD32 x 0x0
# RELAX-NEXT: 0x14 R_LARCH_SUB32 y 0x0
# RELAX-NEXT: }
# CHECK-NEXT: ]
.section .sx,"ax"
nop
x:
la.pcrel $a0, z
.4byte y-x
.data
.8byte x-.
.8byte y-.
.4byte x-.
.4byte y-.
.8byte x-y
.8byte y-x
.4byte x-y
.4byte y-x
.8byte .-x
.4byte .-y
1:
.4byte 0xbeef-1b
1:
.8byte 0xbeef-1b
.section .sy,"ax"
call36 foo
y:
.p2align 4
.4byte x-y