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

68 lines
2.0 KiB
ArmAsm

# RUN: llvm-mc --triple=loongarch64 %s --show-encoding \
# RUN: | FileCheck --check-prefix=CHECK-FIXUP %s
# RUN: llvm-mc --filetype=obj --triple=loongarch64 %s \
# RUN: | llvm-objdump -d - | FileCheck --check-prefix=CHECK-INSTR %s
# RUN: llvm-mc --filetype=obj --triple=loongarch64 %s \
# RUN: | llvm-readobj -r - | FileCheck --check-prefix=CHECK-REL %s
## Checks that fixups that can be resolved within the same object file are
## applied correctly.
.LBB0:
lu12i.w $t1, %abs_hi20(val)
# CHECK-FIXUP: fixup A - offset: 0, value: %abs_hi20(val), kind: fixup_loongarch_abs_hi20
# CHECK-INSTR: lu12i.w $t1, 74565
ori $t1, $t1, %abs_lo12(val)
# CHECK-FIXUP: fixup A - offset: 0, value: %abs_lo12(val), kind: fixup_loongarch_abs_lo12
# CHECK-INSTR: ori $t1, $t1, 1656
b .LBB0
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB0, kind: fixup_loongarch_b26
# CHECK-INSTR: b -8
b .LBB2
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB2, kind: fixup_loongarch_b26
# CHECK-INSTR: b 331004
beq $a0, $a1, .LBB0
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB0, kind: fixup_loongarch_b16
# CHECK-INSTR: beq $a0, $a1, -16
blt $a0, $a1, .LBB1
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB1, kind: fixup_loongarch_b16
# CHECK-INSTR: blt $a0, $a1, 1116
beqz $a0, .LBB0
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB0, kind: fixup_loongarch_b21
# CHECK-INSTR: beqz $a0, -24
bnez $a0, .LBB1
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB1, kind: fixup_loongarch_b21
# CHECK-INSTR: bnez $a0, 1108
.fill 1104
.LBB1:
.fill 329876
nop
.LBB2:
.set val, 0x12345678
# CHECK-REL-NOT: R_LARCH
## Testing the function call offset could resolved by assembler
## when the function and the callsite within the same compile unit.
func:
.fill 100
bl func
# CHECK-FIXUP: fixup A - offset: 0, value: func, kind: fixup_loongarch_b26
# CHECK-INSTR: bl -100
.fill 10000
bl func
# CHECK-FIXUP: fixup A - offset: 0, value: func, kind: fixup_loongarch_b26
# CHECK-INSTR: bl -10104
.fill 20888
bl func
# CHECK-FIXUP: fixup A - offset: 0, value: func, kind: fixup_loongarch_b26
# CHECK-INSTR: bl -30996