xref: /llvm-project/bolt/test/RISCV/reloc-label-diff.s (revision b410d24a194482bbf06aed8956083fabd52d6069)
1// RUN: %clang %cflags -o %t %s
2// RUN: llvm-bolt -o %t.bolt %t
3// RUN: llvm-readelf -x .data %t.bolt | FileCheck %s
4
5  .text
6  .option norvc
7  .globl _start
8  .p2align 1
9_start:
10  // Force BOLT into relocation mode
11  .reloc 0, R_RISCV_NONE
12  // BOLT removes this nop so the label difference is initially 8 but should be
13  // 4 after BOLT processes it.
14  nop
15  beq x0, x0, _test_end
16_test_end:
17  ret
18  .size _start, .-_start
19
20  .data
21// CHECK: Hex dump of section '.data':
22// CHECK: 0x{{.*}} 04000000
23  .word _test_end - _start
24