Home | History | Annotate | Download | only in RISCV
      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
     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:
     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
     34 # INSTR: jr  t1
     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
     40 # INSTR: jr  t1
     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
     46 # INSTR: jr  t1
     47 # FIXUP: fixup A - offset: 0, value: ra, kind:
     48