xref: /llvm-project/bolt/test/AArch64/prevent-ci-folding.s (revision d0e29e87cdc8bb35490abb47e81d1b19823a0687)
1// This test checks that functions containing Constant Islands are not folded even
2// if they have the same data
3
4// RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
5// RUN: %clang %cflags --target=aarch64-unknown-linux %t.o -o %t.exe -Wl,-q
6// RUN: llvm-bolt -icf -lite=false %t.exe -o %t.bolt
7// RUN: llvm-objdump -d -j .text %t.bolt | FileCheck %s
8
9// CHECK: <func1>:
10// CHECK: <func2>:
11
12func1:
13    add x0, x0, #1
14    ret
15    .word 0xdeadbeef
16    .word 0xdeadbeef
17.size func1, .-func1
18
19func2:
20    add x0, x0, #1
21    ret
22    .word 0xdeadbeef
23    .word 0xdeadbeef
24.size func2, .-func2
25
26.global        main
27.type  main, %function
28main:
29    mov x0, #0
30    bl     func1
31    bl     func2
32    sub     x0, x0, #2
33    mov     w8, #93
34    svc     #0
35