Files
clang-p2996/bolt/test/RISCV/reloc-label-diff.s
Job Noorman b410d24a19 [BOLT][RISCV] Implement R_RISCV_ADD32/SUB32
Thispatch implements the R_RISCV_ADD32 and R_RISCV_SUB32 relocations for
RISC-V.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D146554
2023-06-22 09:35:54 +02:00

24 lines
528 B
ArmAsm

// RUN: %clang %cflags -o %t %s
// RUN: llvm-bolt -o %t.bolt %t
// RUN: llvm-readelf -x .data %t.bolt | FileCheck %s
.text
.option norvc
.globl _start
.p2align 1
_start:
// Force BOLT into relocation mode
.reloc 0, R_RISCV_NONE
// BOLT removes this nop so the label difference is initially 8 but should be
// 4 after BOLT processes it.
nop
beq x0, x0, _test_end
_test_end:
ret
.size _start, .-_start
.data
// CHECK: Hex dump of section '.data':
// CHECK: 0x{{.*}} 04000000
.word _test_end - _start