46 lines · plain
1# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+c < %s | \2# RUN: llvm-objdump --no-print-imm-hex -d -M no-aliases --no-show-raw-insn - | \3# RUN: FileCheck %s4 5## Test multiple interleaved auipc/jalr pairs6# CHECK: auipc t0, 071: auipc t0, %pcrel_hi(bar)8# CHECK: auipc t1, 092: auipc t1, %pcrel_hi(bar)10# CHECK: jalr ra, {{[0-9]+}}(t0) <bar>11jalr %pcrel_lo(1b)(t0)12## Target should not be printed because the call above clobbers register state13# CHECK: jalr ra, {{[0-9]+}}(t1){{$}}14jalr %pcrel_lo(2b)(t1)15 16## Test that auipc+jalr with a write to the target register in between does not17## print the target18# CHECK: auipc t0, 0191: auipc t0, %pcrel_hi(bar)20# CHECK: c.li t0, 021li t0, 022# CHECK: jalr ra, {{[0-9]+}}(t0){{$}}23jalr %pcrel_lo(1b)(t0)24 25## Test that auipc+jalr with a write to an unrelated register in between does26## print the target27# CHECK: auipc t0, 0281: auipc t0, %pcrel_hi(bar)29# CHECK: c.li t1, 030li t1, 031# CHECK: jalr ra, {{[0-9]+}}(t0) <bar>32jalr %pcrel_lo(1b)(t0)33 34## Test that auipc+jalr with a terminator in between does not print the target35# CHECK: auipc t0, 0361: auipc t0, %pcrel_hi(bar)37# CHECK: c.j {{.*}} <bar>38j bar39# CHECK: jalr ra, {{[0-9]+}}(t0){{$}}40jalr %pcrel_lo(1b)(t0)41 42# CHECK-LABEL: <bar>:43bar:44# CHECK: c.nop45nop46