[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / bolt / test / X86 / fragment-lite.s
blob97069bf8096e1ce56c88c28dd619e4ab1ff94bed
1 # Check that BOLT in lite mode processes fragments as expected.
3 # RUN: split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %t/main.s -o %t.o
5 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %t/baz.s -o %t.baz.o
6 # RUN: link_fdata %s %t.o %t.main.fdata
7 # RUN: link_fdata %s %t.baz.o %t.baz.fdata
8 # RUN: merge-fdata %t.main.fdata %t.baz.fdata > %t.fdata
9 # RUN: %clang %cflags %t.o %t.baz.o -o %t.exe -Wl,-q
10 # RUN: llvm-bolt %t.exe -o %t.out --lite=1 --data %t.fdata -v=1 -print-cfg \
11 # RUN: 2>&1 | FileCheck %s
13 # CHECK: BOLT-INFO: processing main.cold.1 as a sibling of non-ignored function
14 # CHECK: BOLT-INFO: processing foo.cold.1/1 as a sibling of non-ignored function
15 # CHECK: BOLT-INFO: processing bar.cold.1/1 as a sibling of non-ignored function
16 # CHECK: BOLT-INFO: processing baz.cold.1 as a sibling of non-ignored function
17 # CHECK: BOLT-INFO: processing baz.cold.1/1 as a sibling of non-ignored function
19 # CHECK: Binary Function "main.cold.1" after building cfg
20 # CHECK: Parent : main
22 # CHECK: Binary Function "foo.cold.1/1" after building cfg
23 # CHECK: Parent : foo
25 # CHECK: Binary Function "bar.cold.1/1" after building cfg
26 # CHECK: Parent : bar/1
28 # CHECK: Binary Function "baz.cold.1" after building cfg
29 # CHECK: Parent : baz{{$}}
31 # CHECK: Binary Function "baz.cold.1/1" after building cfg
32 # CHECK: Parent : baz/1
34 #--- main.s
35 .globl main
36 .type main, %function
37 main:
38 .cfi_startproc
39 # FDATA: 0 [unknown] 0 1 main 0 1 0
40 cmpl $0x0, %eax
41 je main.cold.1
42 retq
43 .cfi_endproc
44 .size main, .-main
46 .globl foo
47 .type foo, %function
48 foo:
49 .cfi_startproc
50 # FDATA: 0 [unknown] 0 1 foo 0 1 0
51 cmpl $0x0, %eax
52 je foo.cold.1
53 retq
54 .cfi_endproc
55 .size foo, .-foo
57 .local bar
58 .type bar, %function
59 bar:
60 .cfi_startproc
61 # FDATA: 0 [unknown] 0 1 bar/1 0 1 0
62 cmpl $0x0, %eax
63 je bar.cold.1
64 retq
65 .cfi_endproc
66 .size bar, .-bar
68 .globl baz
69 .type baz, %function
70 baz:
71 .cfi_startproc
72 # FDATA: 0 [unknown] 0 1 baz 0 1 0
73 cmpl $0x0, %eax
74 je baz.cold.1
75 retq
76 .cfi_endproc
77 .size baz, .-baz
79 .section .text.cold
80 .globl main.cold.1
81 .type main.cold.1, %function
82 main.cold.1:
83 .cfi_startproc
84 pushq %rbp
85 movq %rsp, %rbp
86 movl $0x0, %eax
87 popq %rbp
88 retq
89 .cfi_endproc
90 .size main.cold.1, .-main.cold.1
92 .local foo.cold.1
93 .type foo.cold.1, %function
94 foo.cold.1:
95 .cfi_startproc
96 pushq %rbp
97 movq %rsp, %rbp
98 movl $0x0, %eax
99 popq %rbp
100 retq
101 .cfi_endproc
102 .size foo.cold.1, .-foo.cold.1
104 .local bar.cold.1
105 .type bar.cold.1, %function
106 bar.cold.1:
107 .cfi_startproc
108 pushq %rbp
109 movq %rsp, %rbp
110 movl $0x0, %eax
111 popq %rbp
112 retq
113 .cfi_endproc
114 .size bar.cold.1, .-bar.cold.1
116 .globl baz.cold.1
117 .type baz.cold.1, %function
118 baz.cold.1:
119 .cfi_startproc
120 pushq %rbp
121 movq %rsp, %rbp
122 movl $0x0, %eax
123 popq %rbp
124 retq
125 .cfi_endproc
126 .size baz.cold.1, .-baz.cold.1
128 #--- baz.s
129 .local baz
130 .type baz, %function
131 baz:
132 .cfi_startproc
133 # FDATA: 0 [unknown] 0 1 baz/1 0 1 0
134 cmpl $0x0, %eax
135 je baz.cold.1
136 retq
137 .cfi_endproc
138 .size baz, .-baz
140 .section .text.cold
141 .local baz.cold.1
142 .type baz.cold.1, %function
143 baz.cold.1:
144 .cfi_startproc
145 pushq %rbp
146 movq %rsp, %rbp
147 movl $0x0, %eax
148 popq %rbp
149 retq
150 .cfi_endproc
151 .size baz.cold.1, .-baz.cold.1