Files
TheRock/compiler/amd-llvm/llvm/test/MC/RISCV/xqcibi-linker-relaxation.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

85 lines
2.4 KiB
ArmAsm

# RUN: llvm-mc --triple=riscv32 -mattr=+relax,+xqcilb,+xqcibi \
# RUN: %s -filetype=obj -o - -riscv-add-build-attributes \
# RUN: | llvm-objdump -dr -M no-aliases - \
# RUN: | FileCheck %s
## This tests that we correctly emit relocations for linker relaxation when
## relaxing `JAL` to `QC.E.JAL`.
## PR150071
.global foo
# CHECK-LABEL: <branch_over_relaxable>:
branch_over_relaxable:
jal x1, foo
# CHECK: qc.e.jal 0x0 <branch_over_relaxable>
# CHECK-NEXT: R_RISCV_VENDOR QUALCOMM
# CHECK-NEXT: R_RISCV_QC_E_CALL_PLT foo
# CHECK-NEXT: R_RISCV_RELAX *ABS*
bne a0, a1, branch_over_relaxable
# CHECK-NEXT: bne a0, a1, 0x6 <branch_over_relaxable+0x6>
# CHECK-NEXT: R_RISCV_BRANCH branch_over_relaxable
# CHECK-NOT: R_RISCV_RELAX
qc.e.bnei a0, 0x21, branch_over_relaxable
# CHECK-NEXT: qc.e.bnei a0, 0x21, 0xa <branch_over_relaxable+0xa>
# CHECK-NEXT: R_RISCV_VENDOR QUALCOMM
# CHECK-NEXT: R_RISCV_QC_E_BRANCH branch_over_relaxable
# CHECK-NOT: R_RISCV_RELAX
ret
# CHECK-NEXT: c.jr ra
# CHECK-LABEL: <short_jump_over_fixed>:
short_jump_over_fixed:
nop
# CHECK: c.nop
j short_jump_over_fixed
# CHECK-NEXT: c.j 0x12 <short_jump_over_fixed>
# CHECK-NOT: R_RISCV_RVC_JUMP
# CHECK-NOT: R_RISCV_RELAX
ret
# CHECK-NEXT: c.jr ra
# CHECK-LABEL: <short_jump_over_relaxable>:
short_jump_over_relaxable:
call foo
# CHECK: auipc ra, 0x0
# CHECK-NEXT: R_RISCV_CALL_PLT foo
# CHECK-NEXT: R_RISCV_RELAX *ABS*
# CHECK-NEXT: jalr ra, 0x0(ra) <short_jump_over_relaxable>
j short_jump_over_relaxable
# CHECK-NEXT: c.j 0x20 <short_jump_over_relaxable+0x8>
# CHECK-NEXT: R_RISCV_RVC_JUMP short_jump_over_relaxable
# CHECK-NOT: R_RISCV_RELAX
ret
# CHECK-NEXT: c.jr ra
# CHECK-LABEL: <mid_jump_over_fixed>:
mid_jump_over_fixed:
nop
# CHECK: c.nop
.space 0x1000
# CHECK-NEXT: ...
j mid_jump_over_fixed
# CHECK-NEXT: jal zero, 0x1026 <mid_jump_over_fixed+0x1002>
# CHECK-NEXT: R_RISCV_JAL mid_jump_over_fixed
# CHECK-NEXT: R_RISCV_RELAX *ABS*
ret
# CHECK-NEXT: c.jr ra
# CHECK-LABEL: <mid_jump_over_relaxable>:
mid_jump_over_relaxable:
call foo
# CHECK: auipc ra, 0x0
# CHECK-NEXT: R_RISCV_CALL_PLT foo
# CHECK-NEXT: R_RISCV_RELAX *ABS*
# CHECK-NEXT: jalr ra, 0x0(ra) <mid_jump_over_relaxable>
.space 0x1000
# CHECK-NEXT: ...
j mid_jump_over_relaxable
# CHECK-NEXT: jal zero, 0x2034 <mid_jump_over_relaxable+0x1008>
# CHECK-NEXT: R_RISCV_JAL mid_jump_over_relaxable
# CHECK-NEXT: R_RISCV_RELAX
ret
# CHECK-NEXT: c.jr ra