Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / X86 / internal-call-instrument-so.s
blobd13c828f605c3e3d5d8d5b4af93f03ebe198b05f
1 # This reproduces a bug with instrumentation crashes on internal call
3 # REQUIRES: system-linux,bolt-runtime,target=x86_64{{.*}}
5 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
6 # Delete our BB symbols so BOLT doesn't mark them as entry points
7 # RUN: llvm-strip --strip-unneeded %t.o
8 # RUN: ld.lld %t.o -o %t.exe -q -shared -fini=_fini
9 # RUN: llvm-bolt --instrument %t.exe --relocs -o %t.out
11 .text
12 .globl _start
13 .type _start, %function
14 .p2align 4
15 _start:
16 push %rbp
17 mov %rsp,%rbp
18 push %r12
19 push %rbx
20 sub $0x120,%rsp
21 mov $0x3,%rbx
22 .J1:
23 cmp $0x0,%rbx
24 je .J2
25 callq .J3
26 nopl (%rax,%rax,1)
27 lea var@GOTPCREL(%rip),%rax
28 retq
29 .J2:
30 add $0x120,%rsp
31 pop %rbx
32 pop %r12
33 jmp .J4
34 .J3:
35 pop %rax
36 add $0x4,%rax
37 dec %rbx
38 jmp .J1
39 .J4:
40 pop %rbp
41 retq
42 .size _start, .-_start
44 .globl _fini
45 .type _fini, %function
46 .p2align 4
47 _fini:
48 hlt
49 .size _fini, .-_fini
51 .data
52 .globl var
53 var:
54 .quad 0xdeadbeef