118 lines · plain
1# RUN: llvm-mc -triple riscv32 -mattr=+experimental-xqcilb %s \2# RUN: | FileCheck -check-prefix=ASM %s3# RUN: llvm-mc -triple riscv32 -mattr=+experimental-xqcilb %s \4# RUN: -filetype=obj -o - \5# RUN: | llvm-objdump -dr --mattr=+experimental-xqcilb - \6# RUN: | FileCheck -check-prefix=OBJ %s7 8## This test checks that we emit the right relocations for Xqcilb9## relative jumps. These can be resolved within the same section10## (when relaxations are disabled) but otherwise require a11## vendor-specific relocation pair.12 13# This is required so that the conditional jumps are not compressed14# by the assembler15.option exact16 17# ASM-LABEL: this_section:18# OBJ-LABEL: <this_section>:19this_section:20 21# ASM: qc.e.j undef22# OBJ: qc.e.j 0x0 <this_section>23# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}24# OBJ-NEXT: R_RISCV_CUSTOM195 undef{{$}}25qc.e.j undef26 27# ASM: qc.e.jal undef28# OBJ-NEXT: qc.e.jal 0x6 <this_section+0x6>29# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}30# OBJ-NEXT: R_RISCV_CUSTOM195 undef{{$}}31qc.e.jal undef32 33 34# ASM: qc.e.j same_section35# OBJ-NEXT: qc.e.j 0x30 <same_section>36qc.e.j same_section37 38# ASM: qc.e.jal same_section39# OBJ-NEXT: qc.e.jal 0x30 <same_section>40qc.e.jal same_section41 42# ASM: qc.e.j same_section_extern43# OBJ-NEXT: qc.e.j 0x18 <this_section+0x18>44# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}45# OBJ-NEXT: R_RISCV_CUSTOM195 same_section_extern{{$}}46qc.e.j same_section_extern47 48# ASM: qc.e.jal same_section_extern49# OBJ-NEXT: qc.e.jal 0x1e <this_section+0x1e>50# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}51# OBJ-NEXT: R_RISCV_CUSTOM195 same_section_extern{{$}}52qc.e.jal same_section_extern53 54 55# ASM: qc.e.j other_section56# OBJ-NEXT: qc.e.j 0x24 <this_section+0x24>57# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}58# OBJ-NEXT: R_RISCV_CUSTOM195 other_section{{$}}59qc.e.j other_section60 61# ASM: qc.e.jal other_section62# OBJ-NEXT: qc.e.jal 0x2a <this_section+0x2a>63# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}64# OBJ-NEXT: R_RISCV_CUSTOM195 other_section{{$}}65qc.e.jal other_section66 67 68# ASM-LABEL: same_section:69# OBJ-LABEL: <same_section>:70same_section:71 nop72 73# ASM-LABEL: same_section_extern:74# OBJ-LABEL: <same_section_extern>:75 .global same_section_extern76same_section_extern:77 nop78 79.option relax80 81# ASM: qc.e.j same_section82# OBJ: qc.e.j 0x38 <same_section_extern+0x4>83# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}84# OBJ-NEXT: R_RISCV_CUSTOM195 same_section{{$}}85# OBJ-NEXT: R_RISCV_RELAX86qc.e.j same_section87 88# ASM: qc.e.jal same_section89# OBJ-NEXT: qc.e.jal 0x3e <same_section_extern+0xa>90# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}91# OBJ-NEXT: R_RISCV_CUSTOM195 same_section{{$}}92# OBJ-NEXT: R_RISCV_RELAX93qc.e.jal same_section94 95## Enable compression/relaxation to check how symbols are handled.96.option noexact97 98qc.e.j undef99# ASM: j undef100# OBJ: qc.e.j 0x44 <same_section_extern+0x10>101# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}102# OBJ-NEXT: R_RISCV_CUSTOM195 undef{{$}}103# OBJ-NEXT: R_RISCV_RELAX104 105qc.e.jal undef106# ASM: jal undef107# OBJ: qc.e.jal 0x4a <same_section_extern+0x16>108# OBJ-NEXT: R_RISCV_VENDOR QUALCOMM{{$}}109# OBJ-NEXT: R_RISCV_CUSTOM195 undef{{$}}110# OBJ-NEXT: R_RISCV_RELAX111 112.section .text.other, "ax", @progbits113 114# ASM-LABEL: other_section:115# OBJ-LABEL: <other_section>:116other_section:117 nop118