xref: /llvm-project/bolt/test/X86/shared_object_entry.s (revision 11791ae7b0b05b8bd8d806331ff51da618912cf8)
1# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
2# RUN: ld.lld %t.o -o %t.so --shared --entry=func1.cold.1 --emit-relocs
3# RUN: llvm-bolt -relocs %t.so -o %t -reorder-functions=hfsort+ \
4# RUN:    -split-functions -reorder-blocks=ext-tsp -split-all-cold \
5# RUN:    -dyno-stats -icf=1 -use-gnu-stack
6
7## Check that an entry point is a cold symbol
8# RUN: llvm-readelf -h %t.so > %t.log
9# RUN: llvm-nm %t.so >> %t.log
10# RUN: FileCheck %s --input-file %t.log
11# CHECK: Entry point address: 0x[[#%X,ENTRY:]]
12# CHECK: [[#%x,ENTRY]] {{.*}} func1.cold.1
13
14.globl func1.cold.1
15.type func1.cold.1,@function
16func1.cold.1:
17  .cfi_startproc
18.L1:
19		movq %rbx, %rdx
20		jmp .L3
21.L2:
22		# exit(0)
23		movq $60, %rax
24		xorq %rdi, %rdi
25		syscall
26  .size func1.cold.1, .-func1.cold.1
27  .cfi_endproc
28
29.globl func1
30.type func1,@function
31func1:
32  .cfi_startproc
33.L3:
34		movq %rax, %rdi
35		jmp .L2
36  call exit
37  .size func1, .-func1
38  .cfi_endproc
39