[MIParser] Set RegClassOrRegBank during instruction parsing
[llvm-complete.git] / test / MC / RISCV / tail-call.s
blob78c73c1dd3c1e7bdda056bd2bcd8d1fa58cd5590
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
8 # RUN: llvm-mc -filetype=obj -triple riscv64 < %s \
9 # RUN: | llvm-objdump -d - | FileCheck -check-prefix=INSTR %s
10 # RUN: llvm-mc -filetype=obj -triple riscv64 < %s \
11 # RUN: | llvm-readobj -r | FileCheck -check-prefix=RELOC %s
12 # RUN: llvm-mc -triple riscv64 < %s -show-encoding \
13 # RUN: | FileCheck -check-prefix=FIXUP %s
15 .long foo
17 tail foo
18 # RELOC: R_RISCV_CALL foo 0x0
19 # INSTR: auipc t1, 0
20 # INSTR: jr t1
21 # FIXUP: fixup A - offset: 0, value: foo, kind:
22 tail bar
23 # RELOC: R_RISCV_CALL bar 0x0
24 # INSTR: auipc t1, 0
25 # INSTR: jr t1
26 # FIXUP: fixup A - offset: 0, value: bar, kind:
28 # Ensure that tail calls to functions whose names coincide with register names
29 # work.
31 tail zero
32 # RELOC: R_RISCV_CALL zero 0x0
33 # INSTR: auipc t1, 0
34 # INSTR: jr t1
35 # FIXUP: fixup A - offset: 0, value: zero, kind:
37 tail f1
38 # RELOC: R_RISCV_CALL f1 0x0
39 # INSTR: auipc t1, 0
40 # INSTR: jr t1
41 # FIXUP: fixup A - offset: 0, value: f1, kind:
43 tail ra
44 # RELOC: R_RISCV_CALL ra 0x0
45 # INSTR: auipc t1, 0
46 # INSTR: jr t1
47 # FIXUP: fixup A - offset: 0, value: ra, kind:
49 tail foo@plt
50 # RELOC: R_RISCV_CALL_PLT foo 0x0
51 # INSTR: auipc t1, 0
52 # INSTR: jr t1
53 # FIXUP: fixup A - offset: 0, value: foo@plt, kind: