xref: /llvm-project/bolt/test/AArch64/constant-island-alignment.s (revision d648aa1b8e937de1648524e1f1016b53b29ba2a4)
1// This test checks that the constant island is aligned after BOLT tool.
2// In case the nop before .Lci will be removed the pointer to exit function
3// won't be alinged and the test will fail.
4
5# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \
6# RUN:   %s -o %t.o
7# RUN: %clang %cflags -fPIC -pie %t.o -o %t.exe -Wl,-q \
8# RUN:    -nostartfiles -nodefaultlibs -Wl,-z,notext
9# RUN: llvm-bolt %t.exe -o %t.bolt --use-old-text=0 --lite=0 --trap-old-code
10# RUN: llvm-objdump -d --disassemble-symbols='$d' %t.bolt | FileCheck %s
11
12.text
13.align 4
14.global
15.type dummy, %function
16dummy:
17  add x0, x0, #1
18  ret
19
20.global
21.type exitOk, %function
22exitOk:
23  mov x0, #0
24  ret
25
26.global _start
27.type _start, %function
28_start:
29  adrp x0, .Lci
30  ldr x0, [x0, #:lo12:.Lci]
31  blr x0
32  mov x0, #1
33  ret
34  nop
35# CHECK: {{0|8}} <$d>:
36.Lci:
37  .xword exitOk
38  .xword 0
39