1# RUN: llvm-mc -filetype=obj -triple riscv32 < %s \
2# RUN:     | llvm-objdump -d - | FileCheck --check-prefix=INSTR %s
3# RUN: llvm-mc -filetype=obj -triple riscv32 < %s \
4# RUN:     | llvm-readobj -r - | FileCheck -check-prefix=RELOC %s
5# RUN: llvm-mc -triple riscv32 < %s -show-encoding \
6# RUN:     | FileCheck -check-prefix=FIXUP %s
7
8.long foo
9
10jump foo, x31
11# RELOC: R_RISCV_CALL foo 0x0
12# INSTR: auipc t6, 0
13# INSTR: jr  t6
14# FIXUP: fixup A - offset: 0, value: foo, kind: fixup_riscv_call
15
16# Ensure that jumps to symbols whose names coincide with register names work.
17
18jump zero, x1
19# RELOC: R_RISCV_CALL zero 0x0
20# INSTR: auipc ra, 0
21# INSTR: ret
22# FIXUP: fixup A - offset: 0, value: zero, kind: fixup_riscv_call
23
241:
25jump 1b, x31
26# INSTR: auipc t6, 0
27# INSTR: jr  t6
28# FIXUP: fixup A - offset: 0, value: .Ltmp0, kind: fixup_riscv_call
29