Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / AArch64 / exclusive-instrument.s
blob502dd83b2f2a5b8e8f111309d7fce38ad0fad19c
1 // This test checks that the foo function having exclusive memory access
2 // instructions won't be instrumented.
4 // REQUIRES: system-linux,bolt-runtime,target=aarch64{{.*}}
6 // RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \
7 // RUN: %s -o %t.o
8 // RUN: %clang %cflags -fPIC -pie %t.o -o %t.exe -nostdlib -Wl,-q -Wl,-fini=dummy
9 // RUN: llvm-bolt %t.exe -o %t.bolt -instrument -v=1 | FileCheck %s
11 // CHECK: Function foo has exclusive instructions, skip instrumentation
13 .global foo
14 .type foo, %function
15 foo:
16 ldaxr w9, [x10]
17 cbnz w9, .Lret
18 stlxr w12, w11, [x9]
19 cbz w12, foo
20 clrex
21 .Lret:
22 ret
23 .size foo, .-foo
25 .global _start
26 .type _start, %function
27 _start:
28 cmp x0, #0
29 b.eq .Lexit
30 bl foo
31 .Lexit:
32 ret
33 .size _start, .-_start
35 .global dummy
36 .type dummy, %function
37 dummy:
38 ret
39 .size dummy, .-dummy