Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / RISCV / function-alignment.s
blobc52cff9e2347a5ce74fef20644415e8cb543fcf3
1 ## Test that BOLT uses a minimum function alignment of 4 (or 2 for RVC) bytes.
3 # RUN: llvm-mc -triple=riscv64 -filetype=obj -o %t.o %s
4 # RUN: ld.lld -q -o %t %t.o
5 # RUN: llvm-bolt --align-functions=1 --use-old-text=0 -o %t.bolt %t
6 # RUN: llvm-nm -n %t.bolt | FileCheck %s
8 # RUN: llvm-mc -triple=riscv64 -mattr=+c -filetype=obj -o %t-c.o %s
9 # RUN: ld.lld -q -o %t-c %t-c.o
10 # RUN: llvm-bolt --align-functions=1 --use-old-text=0 -o %t-c.bolt %t-c
11 # RUN: llvm-nm -n %t-c.bolt | FileCheck --check-prefix=CHECK-C %s
13 # CHECK: {{[048c]}} T _start
14 # CHECK-NEXT: {{[048c]}} T dummy
16 # CHECK-C: {{[02468ace]}} T _start
17 # CHECK-C-NEXT: {{[02468ace]}} T dummy
19 .text
21 # Make sure input binary is only 1 byte aligned. BOLT should increase the
22 # alignment to 2 or 4 bytes.
23 .byte 0
24 .balign 1
26 .globl _start
27 .type _start, @function
28 _start:
29 # Dummy reloc to force relocation mode.
30 .reloc 0, R_RISCV_NONE
31 ret
32 .size _start, .-_start
34 .globl dummy
35 .type dummy, @function
36 dummy:
37 ret
38 .size dummy, .-dummy