Skip to content

[LoongArch] Pre-commit test for #133225 #133224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions llvm/test/MC/LoongArch/Relocations/relocations.s
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# RUN: llvm-mc --filetype=obj --triple=loongarch64 < %s \
# RUN: | llvm-readobj -r - | FileCheck --check-prefix=RELOC %s

# RUN: not llvm-mc --triple=loongarch64 --defsym=FIXME=1 < %s 2>&1 \
# RUN: | FileCheck --check-prefix=ERROR %s

## Check prefixes:
## RELOC - Check the relocation in the object.
## FIXUP - Check the fixup on the instruction.
Expand Down Expand Up @@ -308,3 +311,25 @@ pcaddi $t1, %desc_pcrel_20(foo)
# RELOC: R_LARCH_TLS_DESC_PCREL20_S2 foo 0x0
# INSTR: pcaddi $t1, %desc_pcrel_20(foo)
# FIXUP: fixup A - offset: 0, value: %desc_pcrel_20(foo), kind: FK_NONE

.ifdef FIXME

fld.s $ft1, $a0, %pc_lo12(foo)
# ERROR: :[[#@LINE-1]]:18: error: immediate must be an integer in the range [-2048, 2047]

fst.d $ft1, $a0, %pc_lo12(foo)
# ERROR: :[[#@LINE-1]]:18: error: immediate must be an integer in the range [-2048, 2047]

vld $vr9, $a0, %pc_lo12(foo)
# ERROR: :[[#@LINE-1]]:16: error: immediate must be an integer in the range [-2048, 2047]

vst $vr9, $a0, %pc_lo12(foo)
# ERROR: :[[#@LINE-1]]:16: error: immediate must be an integer in the range [-2048, 2047]

xvld $xr9, $a0, %pc_lo12(foo)
# ERROR: :[[#@LINE-1]]:17: error: immediate must be an integer in the range [-2048, 2047]

xvst $xr9, $a0, %pc_lo12(foo)
# ERROR: :[[#@LINE-1]]:17: error: immediate must be an integer in the range [-2048, 2047]

.endif