brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 1a03152 Raw
43 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 -o %t.la327# RUN: ld.lld %t.la64.o -o %t.la648# RUN: llvm-objdump -d --no-show-raw-insn %t.la32 | FileCheck %s9# RUN: llvm-objdump -d --no-show-raw-insn %t.la64 | FileCheck %s10# CHECK:      pcalau12i $t0, -111# CHECK-NEXT: jirl  $ra, $t0, 56412# CHECK-NEXT: pcalau12i $t0, 013# CHECK-NEXT: jirl  $zero, $t0, -134814 15## PLT shouldn't get generated in this case.16# CHECK-NOT:  Disassembly of section .plt:17 18.p2align 1219.org 0x23420.global foo21foo:22    li.w    $a0, 4223    ret24 25.org 0xabc26.global bar27bar:28    li.w    $a7, 9429    syscall 030 31.org 0x100032.global _start33_start:34## The nops are for pushing the relocs off page boundary, to better see the35## page-aligned semantics in action.36    nop37    nop38    nop39    pcalau12i   $t0, %pc_hi20(foo)40    jirl        $ra, $t0, %pc_lo12(foo)41    pcalau12i   $t0, %pc_hi20(bar)42    jirl        $zero, $t0, %pc_lo12(bar)43