33 lines · plain
1# REQUIRES: loongarch2 3# RUN: llvm-mc --filetype=obj --triple=loongarch32-unknown-elf %s -o %t.la32.o4# RUN: llvm-mc --filetype=obj --triple=loongarch64-unknown-elf %s -o %t.la64.o5 6# RUN: ld.lld %t.la32.o --section-start=.text=0x20000 --section-start=.data=0x20008 -o %t.la32.17# RUN: ld.lld %t.la64.o --section-start=.text=0x20000 --section-start=.data=0x20008 -o %t.la64.18# RUN: llvm-objdump --no-show-raw-insn -d %t.la32.1 | FileCheck --match-full-lines %s9# RUN: llvm-objdump --no-show-raw-insn -d %t.la64.1 | FileCheck --match-full-lines %s10# CHECK: 20000: pcaddi $t0, 211 12# RUN: not ld.lld %t.la32.o --section-start=.text=0x20000 --section-start=.data=0x220000 -o /dev/null 2>&1 | \13# RUN: FileCheck -DFILE=%t.la32.o --check-prefix=ERROR-RANGE %s14# RUN: not ld.lld %t.la64.o --section-start=.text=0x20000 --section-start=.data=0x220000 -o /dev/null 2>&1 | \15# RUN: FileCheck -DFILE=%t.la64.o --check-prefix=ERROR-RANGE %s16# ERROR-RANGE: error: [[FILE]]:(.text+0x0): relocation R_LARCH_PCREL20_S2 out of range: 2097152 is not in [-2097152, 2097151]; references section '.data'17 18# RUN: not ld.lld %t.la32.o --section-start=.text=0x20000 --section-start=.data=0x40001 -o /dev/null 2>&1 | \19# RUN: FileCheck -DFILE=%t.la32.o --check-prefix=ERROR-ALIGN %s20# RUN: not ld.lld %t.la64.o --section-start=.text=0x20000 --section-start=.data=0x40001 -o /dev/null 2>&1 | \21# RUN: FileCheck -DFILE=%t.la64.o --check-prefix=ERROR-ALIGN %s22# ERROR-ALIGN: error: [[FILE]]:(.text+0x0): improper alignment for relocation R_LARCH_PCREL20_S2: 0x20001 is not aligned to 4 bytes23 24.global _start25 26_start:271:28 pcaddi $t0, 029 .reloc 1b, R_LARCH_PCREL20_S2, .data30 31.data32 .word 033