xref: /llvm-project/bolt/test/X86/lto-name-match.s (revision ab14eb23b6b4939cefa01f8cb16d7540f9686144)
1# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
2# RUN: link_fdata %s %t.o %t.fdata
3# RUN: llvm-strip --strip-unneeded %t.o
4# RUN: %clang %cflags %t.o -o %t.exe
5# RUN: llvm-bolt %t.exe --data %t.fdata -o %t.null | FileCheck %s
6
7## Check that profile is correctly matched by functions with variable suffixes.
8## E.g., LTO-generated name foo.llvm.123 should match foo.llvm.*.
9
10# CHECK: 6 out of {{.*}} functions in the binary {{.*}} have non-empty execution profile
11# CHECK-NOT: profile for {{.*}} objects was ignored
12
13	.globl _start
14_start:
15
16LL_start_0:
17# FDATA: 1 _start #LL_start_0# 1 foo.llvm.321 0 0 1
18  call foo.llvm.123
19
20LL_start_1:
21# FDATA: 1 _start #LL_start_1# 1 foo.constprop.321 0 0 1
22  call foo.constprop.123
23
24LL_start_2:
25# FDATA: 1 _start #LL_start_2# 1 foo.lto_priv.321 0 0 1
26  call foo.lto_priv.123
27
28LL_start_3:
29# FDATA: 1 _start #LL_start_3# 1 foo.__uniq.321 0 0 1
30  call foo.__uniq.123
31
32LL_start_4:
33# FDATA: 1 _start #LL_start_4# 1 foo.__uniq.654.llvm.321 0 0 1
34  call foo.__uniq.456.llvm.123
35
36  call exit
37  .size _start, .-_start
38
39  .globl foo.llvm.123
40  .type foo.llvm.123,@function
41foo.llvm.123:
42  ret
43  .size foo.llvm.123, .-foo.llvm.123
44
45  .globl foo.constprop.123
46  .type foo.constprop.123,@function
47foo.constprop.123:
48  ret
49  .size foo.constprop.123, .-foo.constprop.123
50
51  .globl foo.lto_priv.123
52  .type foo.lto_priv.123,@function
53foo.lto_priv.123:
54  ret
55  .size foo.lto_priv.123, .-foo.lto_priv.123
56
57  .globl foo.__uniq.123
58  .type foo.__uniq.123,@function
59foo.__uniq.123:
60  ret
61  .size foo.__uniq.123, .-foo.__uniq.123
62
63  .globl foo.__uniq.456.llvm.123
64  .type foo.__uniq.456.llvm.123,@function
65foo.__uniq.456.llvm.123:
66  ret
67  .size foo.__uniq.456.llvm.123, .-foo.__uniq.456.llvm.123
68