45 lines · plain
1# REQUIRES: riscv2## Test R_RISCV_CALL referencing the current input section with the displacement3## close to the boundary.4 5# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+c,+relax %s -o %t.o6# RUN: ld.lld -Ttext=0x10000 %t.o -o %t7# RUN: llvm-objdump -d --no-show-raw-insn -M no-aliases %t | FileCheck %s8 9# CHECK-LABEL: <_start>:10# CHECK-NEXT: jal ra, {{.*}} <_start>11# CHECK-NEXT: jal ra, {{.*}} <_start>12# CHECK-EMPTY:13# CHECK-NEXT: <a>:14# CHECK-NEXT: c.jr ra15 16# CHECK-LABEL: <b>:17# CHECK: jal zero, {{.*}} <a>18# CHECK-NEXT: jal zero, {{.*}} <c>19# CHECK-NEXT: c.j {{.*}} <c>20 21# CHECK-LABEL: <c>:22# CHECK-NEXT: c.jr ra23 24#--- a.s25.global _start26_start:27 call _start28 call _start29 30a:31 ret32b:33 .space 204834## Relaxed to jal. If we don't compute the precise value of a, we may consider35## a reachable by c.j.36 tail a37## Relaxed to jal. c.j is unreachable.38 tail c # c.j39## Relaxed to c.j. If we don't compute the precise value of c, we may consider40## c.j unreachable.41 tail c # c.j42 .space 204243c:44 ret45