[X86][MC,LLD][NFC] Rename R_X86_64_REX2_GOTPCRELX (#116737)
[llvm-project.git] / llvm / test / MC / RISCV / tail-call.s
blob7c9f28bdfacda429d3fc7599c1d7fe3a68d57382
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 # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-zicfilp < %s \
16 # RUN: | llvm-objdump -d - | FileCheck --check-prefix=INSTR-ZICFILP %s
17 # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-zicfilp < %s \
18 # RUN: | llvm-readobj -r - | FileCheck -check-prefix=RELOC %s
19 # RUN: llvm-mc -triple riscv32 -mattr=+experimental-zicfilp < %s -show-encoding \
20 # RUN: | FileCheck -check-prefix=FIXUP %s
22 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+experimental-zicfilp < %s \
23 # RUN: | llvm-objdump -d - | FileCheck --check-prefix=INSTR-ZICFILP %s
24 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+experimental-zicfilp < %s \
25 # RUN: | llvm-readobj -r - | FileCheck -check-prefix=RELOC %s
26 # RUN: llvm-mc -triple riscv64 -mattr=+experimental-zicfilp < %s -show-encoding \
27 # RUN: | FileCheck -check-prefix=FIXUP %s
29 .long foo
31 tail foo
32 # RELOC: R_RISCV_CALL_PLT foo 0x0
33 # INSTR: auipc t1, 0
34 # INSTR: jr t1
35 # INSTR-ZICFILP: auipc t2, 0
36 # INSTR-ZICFILP: jr t2
37 # FIXUP: fixup A - offset: 0, value: foo, kind:
39 tail bar
40 # RELOC: R_RISCV_CALL_PLT bar 0x0
41 # INSTR: auipc t1, 0
42 # INSTR: jr t1
43 # INSTR-ZICFILP: auipc t2, 0
44 # INSTR-ZICFILP: jr t2
45 # FIXUP: fixup A - offset: 0, value: bar, kind:
47 # Ensure that tail calls to functions whose names coincide with register names
48 # work.
50 tail zero
51 # RELOC: R_RISCV_CALL_PLT zero 0x0
52 # INSTR: auipc t1, 0
53 # INSTR: jr t1
54 # INSTR-ZICFILP: auipc t2, 0
55 # INSTR-ZICFILP: jr t2
56 # FIXUP: fixup A - offset: 0, value: zero, kind:
58 tail f1
59 # RELOC: R_RISCV_CALL_PLT f1 0x0
60 # INSTR: auipc t1, 0
61 # INSTR: jr t1
62 # INSTR-ZICFILP: auipc t2, 0
63 # INSTR-ZICFILP: jr t2
64 # FIXUP: fixup A - offset: 0, value: f1, kind:
66 tail ra
67 # RELOC: R_RISCV_CALL_PLT ra 0x0
68 # INSTR: auipc t1, 0
69 # INSTR: jr t1
70 # INSTR-ZICFILP: auipc t2, 0
71 # INSTR-ZICFILP: jr t2
72 # FIXUP: fixup A - offset: 0, value: ra, kind:
74 tail foo@plt
75 # RELOC: R_RISCV_CALL_PLT foo 0x0
76 # INSTR: auipc t1, 0
77 # INSTR: jr t1
78 # INSTR-ZICFILP: auipc t2, 0
79 # INSTR-ZICFILP: jr t2
80 # FIXUP: fixup A - offset: 0, value: foo, kind: fixup_riscv_call_plt