xref: /llvm-project/bolt/test/AArch64/ext-double-jump.s (revision d648aa1b8e937de1648524e1f1016b53b29ba2a4)
1# This test checks that remove double jumps pass works properly with
2# non-local branches.
3
4# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
5# RUN: %clang %cflags -nostartfiles -nodefaultlibs %t.o -o %t.exe -Wl,-q
6# RUN: llvm-bolt %t.exe -o %t.bolt --peepholes=double-jumps
7
8  .text
9  .align 4
10  .global dummy1
11  .type dummy1, %function
12dummy1:
13  mov x2, x0
14  ret
15  .size dummy1, .-dummy1
16
17  .global dummy2
18  .type dummy2, %function
19dummy2:
20  mov x1, x0
21  ret
22  .size dummy2, .-dummy2
23
24  .global _start
25  .type _start, %function
26_start:
27  cbz  x10, 1f
28  b dummy1
291:
30  b dummy2
31  .size _start, .-_start
32