xref: /llvm-project/lld/test/ELF/riscv-relax-call-mixed-rvc.s (revision 62213be8726d8b036c1c1b8fa1f0228608350f17)
1# REQUIRES: riscv
2# RUN: rm -rf %t && split-file %s %t && cd %t
3# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+c,+relax a.s -o a.o
4# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=-c,+relax b.s -o b.o
5
6# RUN: ld.lld a.o b.o --shared -o a -Ttext=0x10000
7# RUN: llvm-objdump -d --no-show-raw-insn -M no-aliases a | FileCheck %s
8
9## This needs to be a *uncompressed* jal instruction since it came from the
10## source file which does not enable C
11# CHECK-LABEL: <foo>:
12# CHECK-NEXT:    10000: jal zero, {{.*}} <foo>
13# CHECK-NEXT:    10004: sub zero, zero, zero
14
15# w/ C
16#--- a.s
17	.text
18	.attribute	4, 16
19	.attribute	5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
20
21# w/o C
22#--- b.s
23	.text
24	.attribute	4, 16
25	.attribute	5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_zicsr2p0_zifencei2p0"
26	.p2align	5
27	.type	foo,@function
28foo:
29    tail    foo
30    # Pick a non-canonical nop to ensure test output can't be confused
31    # with riscv_align padding
32    sub zero, zero, zero
33