35 lines · plain
1# RUN: llvm-mc -mattr -relax -triple riscv64 -filetype obj %s -o - | llvm-readobj -d -r - | FileCheck %s2 3.global function4 5# CHECK: .rela.text {6 7# Unrelaxed reference, this would normally fail, but the subsequent scoped8# relaxation forces relaxation on the file.9.dword function - .10 11# CHECK: 0x0 R_RISCV_ADD64 function 0x012# CHECK-NEXT: 0x0 R_RISCV_SUB64 .L0 0x013 14# Relaxed reference, this will resolve to a pair of `RISCV_ADD64` and15# `RISCV_SUB64` relocation.16.option push17.option relax18.dword function - .19.option pop20 21# CHECK: 0x8 R_RISCV_ADD64 function 0x022# CHECK-NEXT: 0x8 R_RISCV_SUB64 .L0 0x023 24# Unrelaxed reference, this will resolve to a pair of `RISCV_ADD64` and25# `RISCV_SUB64` relocation due to relaxation being sticky to the file.26.option push27.option norelax28.dword function - .29.option pop30 31# CHECK: 0x10 R_RISCV_ADD64 function 0x032# CHECK-NEXT: 0x10 R_RISCV_SUB64 .L0 0x033 34# CHECK: }35