[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / bolt / test / X86 / internal-call-instrument.s
blobc393f1dac864718c38dc6080394d495b6d119171
1 # This reproduces a bug with instrumentation crashes on internal call
3 # REQUIRES: x86_64-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: %clang %cflags %t.o -o %t.exe -Wl,-q
10 # RUN: llvm-bolt --instrument %t.exe --relocs -o %t.out
12 .text
13 .globl _start
14 .type _start, %function
15 .p2align 4
16 _start:
17 call main
18 ret
19 .size _start, .-_start
21 .globl main
22 .type main, %function
23 .p2align 4
24 main:
25 push %rbp
26 mov %rsp,%rbp
27 push %r12
28 push %rbx
29 sub $0x120,%rsp
30 mov $0x3,%rbx
31 movq rel(%rip), %rdi
32 .J1:
33 cmp $0x0,%rbx
34 je .J2
35 callq .J3
36 nopl (%rax,%rax,1)
37 movabs $0xdeadbeef,%rax
38 retq
39 .J2:
40 add $0x120,%rsp
41 pop %rbx
42 pop %r12
43 jmp .J4
44 .J3:
45 pop %rax
46 add $0x4,%rax
47 dec %rbx
48 jmp .J1
49 .J4:
50 pop %rbp
51 retq
52 end:
53 .size main, .-main
55 .globl _fini
56 .type _fini, %function
57 .p2align 4
58 _fini:
59 hlt
60 .size _fini, .-_fini
62 .data
63 rel: .quad end