brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 9ebf512 Raw
68 lines · plain
1# RUN: llvm-mc -filetype=obj -triple riscv32 < %s \2# RUN:     | llvm-objdump --no-print-imm-hex -M no-aliases -d - \3# RUN:     | FileCheck -check-prefix=CHECK-INSTR %s4# RUN: llvm-mc -filetype=obj -triple=riscv32 %s \5# RUN:     | llvm-readobj -r - | FileCheck %s -check-prefix=CHECK-REL6 7# Checks that fixups that can be resolved within the same object file are8# applied correctly9 10.LBB0:11lui t1, %hi(val)12# CHECK-INSTR: lui t1, 7456513 14lw a0, %lo(val)(t1)15# CHECK-INSTR: lw a0, 1656(t1)16addi a1, t1, %lo(val)17# CHECK-INSTR: addi a1, t1, 165618sw a0, %lo(val)(t1)19# CHECK-INSTR: sw a0, 1656(t1)20 211:22auipc t1, %pcrel_hi(.LBB0)23# CHECK-INSTR: auipc t1, 024addi t1, t1, %pcrel_lo(1b)25# CHECK-INSTR: addi t1, t1, -1626sw t1, %pcrel_lo(1b)(t1)27# CHECK-INSTR: sw t1, -16(t1)28 29jal zero, .LBB030# CHECK-INSTR: jal zero, 0x031jal zero, .LBB232# CHECK-INSTR: jal zero, 0x50d1433beq a0, a1, .LBB034# CHECK-INSTR: beq a0, a1, 0x035blt a0, a1, .LBB136# CHECK-INSTR: blt a0, a1, 0x47c37 38.fill 110439 40.LBB1:41 42.fill 32987643addi zero, zero, 044.LBB2:45 46.set val, 0x1234567847 48# CHECK-REL-NOT: R_RISCV49 50# Testing the function call offset could resolved by assembler51# when the function and the callsite within the same compile unit52# and the linker relaxation is disabled.53func:54.fill 10055call func56# CHECK-INSTR: auipc   ra, 057# CHECK-INSTR: jalr    ra, -100(ra)58 59.fill 1000060call func61# CHECK-INSTR: auipc   ra, 104857462# CHECK-INSTR: jalr    ra, -1916(ra)63 64.fill 2088865call func66# CHECK-INSTR: auipc   ra, 104856867# CHECK-INSTR: jalr    ra, 1764(ra)68