Mandeep Singh Grang | ef0ebf2 | 2018-05-17 17:31:27 +0000 | [diff] [blame] | 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 | # 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 |
| 14 | |
| 15 | .long foo |
| 16 | |
| 17 | tail foo |
| 18 | # RELOC: R_RISCV_CALL foo 0x0 |
| 19 | # INSTR: auipc t1, 0 |
Sameer AbuAsal | e01e711 | 2018-06-21 14:37:09 +0000 | [diff] [blame] | 20 | # INSTR: jr t1 |
Mandeep Singh Grang | ef0ebf2 | 2018-05-17 17:31:27 +0000 | [diff] [blame] | 21 | # FIXUP: fixup A - offset: 0, value: foo, kind: |
| 22 | tail bar |
| 23 | # RELOC: R_RISCV_CALL bar 0x0 |
| 24 | # INSTR: auipc t1, 0 |
Sameer AbuAsal | e01e711 | 2018-06-21 14:37:09 +0000 | [diff] [blame] | 25 | # INSTR: jr t1 |
Mandeep Singh Grang | ef0ebf2 | 2018-05-17 17:31:27 +0000 | [diff] [blame] | 26 | # FIXUP: fixup A - offset: 0, value: bar, kind: |
| 27 | |
| 28 | # Ensure that tail calls to functions whose names coincide with register names |
| 29 | # work. |
| 30 | |
| 31 | tail zero |
| 32 | # RELOC: R_RISCV_CALL zero 0x0 |
| 33 | # INSTR: auipc t1, 0 |
Sameer AbuAsal | e01e711 | 2018-06-21 14:37:09 +0000 | [diff] [blame] | 34 | # INSTR: jr t1 |
Mandeep Singh Grang | ef0ebf2 | 2018-05-17 17:31:27 +0000 | [diff] [blame] | 35 | # FIXUP: fixup A - offset: 0, value: zero, kind: |
| 36 | |
| 37 | tail f1 |
| 38 | # RELOC: R_RISCV_CALL f1 0x0 |
| 39 | # INSTR: auipc t1, 0 |
Sameer AbuAsal | e01e711 | 2018-06-21 14:37:09 +0000 | [diff] [blame] | 40 | # INSTR: jr t1 |
Mandeep Singh Grang | ef0ebf2 | 2018-05-17 17:31:27 +0000 | [diff] [blame] | 41 | # FIXUP: fixup A - offset: 0, value: f1, kind: |
| 42 | |
| 43 | tail ra |
| 44 | # RELOC: R_RISCV_CALL ra 0x0 |
| 45 | # INSTR: auipc t1, 0 |
Sameer AbuAsal | e01e711 | 2018-06-21 14:37:09 +0000 | [diff] [blame] | 46 | # INSTR: jr t1 |
Mandeep Singh Grang | ef0ebf2 | 2018-05-17 17:31:27 +0000 | [diff] [blame] | 47 | # FIXUP: fixup A - offset: 0, value: ra, kind: |