39 lines · plain
1## Test that BOLT uses a minimum function alignment of 4 (or 2 for RVC) bytes.2 3# RUN: llvm-mc -triple=riscv64 -filetype=obj -o %t.o %s4# RUN: ld.lld -q -o %t %t.o5# RUN: llvm-bolt --align-functions=1 --use-old-text=0 -o %t.bolt %t6# RUN: llvm-nm -n %t.bolt | FileCheck %s7 8# RUN: llvm-mc -triple=riscv64 -mattr=+c -filetype=obj -o %t-c.o %s9# RUN: ld.lld -q -o %t-c %t-c.o10# RUN: llvm-bolt --align-functions=1 --use-old-text=0 -o %t-c.bolt %t-c11# RUN: llvm-nm -n %t-c.bolt | FileCheck --check-prefix=CHECK-C %s12 13# CHECK: {{[048c]}} T _start14# CHECK-NEXT: {{[048c]}} T dummy15 16# CHECK-C: {{[02468ace]}} T _start17# CHECK-C-NEXT: {{[02468ace]}} T dummy18 19 .text20 21 # Make sure input binary is only 1 byte aligned. BOLT should increase the22 # alignment to 2 or 4 bytes.23 .byte 024 .balign 125 26 .globl _start27 .type _start, @function28_start:29 # Dummy reloc to force relocation mode.30 .reloc 0, R_RISCV_NONE31 ret32 .size _start, .-_start33 34 .globl dummy35 .type dummy, @function36dummy:37 ret38 .size dummy, .-dummy39