[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / riscv-relax-call-intra-sec.s
blobbedb8edf838dd2cf695bc82ccfa4402c05759c5b
1 # REQUIRES: riscv
2 ## Test R_RISCV_CALL referencing the current input section with the displacement
3 ## close to the boundary.
5 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+c,+relax %s -o %t.o
6 # RUN: ld.lld -Ttext=0x10000 %t.o -o %t
7 # RUN: llvm-objdump -d --no-show-raw-insn -M no-aliases %t | FileCheck %s
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 ra
16 # CHECK-LABEL: <b>:
17 # CHECK: jal zero, {{.*}} <a>
18 # CHECK-NEXT: jal zero, {{.*}} <c>
19 # CHECK-NEXT: c.j {{.*}} <c>
21 # CHECK-LABEL: <c>:
22 # CHECK-NEXT: c.jr ra
24 #--- a.s
25 .global _start
26 _start:
27 call _start
28 call _start
31 ret
33 .space 2048
34 ## Relaxed to jal. If we don't compute the precise value of a, we may consider
35 ## a reachable by c.j.
36 tail a
37 ## Relaxed to jal. c.j is unreachable.
38 tail c # c.j
39 ## Relaxed to c.j. If we don't compute the precise value of c, we may consider
40 ## c.j unreachable.
41 tail c # c.j
42 .space 2042
44 ret