1 # RUN: llvm-mc %s -triple=riscv32 | FileCheck -check-prefix=ASM %s
2 # RUN: llvm-mc %s -triple=riscv64 | FileCheck -check-prefix=ASM %s
3 # RUN: llvm-mc -filetype=obj -triple riscv32 < %s \
4 # RUN: | llvm-objdump -d -M no-aliases - | FileCheck -check-prefix=DISASM %s
5 # RUN: llvm-mc -filetype=obj -triple riscv64 < %s \
6 # RUN: | llvm-objdump -d -M no-aliases - | FileCheck -check-prefix=DISASM %s
8 # Checks change of options does not cause error: could not find corresponding %pcrel_hi
9 # when assembling pseudoinstruction and its extended form.
18 # ASM: auipc a0, %pcrel_hi(a_symbol)
19 # ASM: addi a0, a0, %pcrel_lo(.Lpcrel_hi0)
21 # ASM: auipc a1, %pcrel_hi(another_symbol)
22 # ASM: addi a1, a1, %pcrel_lo(.Lpcrel_hi1)
24 # DISASM: .Lpcrel_hi0:
26 # DISASM: addi a0, a0, 0
29 # DISASM: addi a1, a1, 0
33 1:auipc a0
, %pcrel_hi
(a_symbol
)
34 addi a0
, a0
, %pcrel_lo
(1b)
36 2:auipc a1
, %pcrel_hi
(another_symbol
)
37 addi a1
, a1
, %pcrel_lo
(2b)
40 # ASM: auipc a0, %pcrel_hi(a_symbol)
41 # ASM: addi a0, a0, %pcrel_lo(.Ltmp0)
43 # ASM: auipc a1, %pcrel_hi(another_symbol)
44 # ASM: addi a1, a1, %pcrel_lo(.Ltmp1)
48 # DISASM: addi a0, a0, 0
51 # DISASM: addi a1, a1, 0