Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / X86 / bug-function-layout-execount.s
blob540b6790d01e900a77ccd1b2740b13ea24042108
1 # Verifies that llvm-bolt correctly sorts functions by their execution counts.
3 # REQUIRES: x86_64-linux, asserts
5 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
6 # RUN: link_fdata %s %t.o %t.fdata
7 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
8 # RUN: llvm-bolt %t.exe --data %t.fdata --lite --reorder-functions=exec-count \
9 # RUN: -v=2 --debug-only=hfsort -o /dev/null 2>&1 | FileCheck %s
11 # CHECK: Starting pass: reorder-functions
12 # CHECK-NEXT: hot func func2 (1500)
13 # CHECK-NEXT: hot func func1 (500)
14 # CHECK-NEXT: hot func main (400)
15 # CHECK-NEXT: hot func func5 (110)
16 # CHECK-NEXT: hot func func3 (100)
17 # CHECK-NEXT: hot func func4 (99)
19 .text
20 .globl main
21 .type main, %function
22 main:
23 # FDATA: 0 [unknown] 0 1 main 0 1 400
24 .cfi_startproc
25 call func1
26 retq
27 .size _start, .-_start
28 .cfi_endproc
30 .globl func1
31 .type func1,@function
32 func1:
33 # FDATA: 0 [unknown] 0 1 func1 0 1 500
34 .cfi_startproc
35 retq
36 .size func1, .-func1
37 .cfi_endproc
39 .globl func2
40 .type func2,@function
41 func2:
42 # FDATA: 0 [unknown] 0 1 func2 0 1 1500
43 .cfi_startproc
44 retq
45 .size func2, .-func2
46 .cfi_endproc
48 .globl func3
49 .type func3,@function
50 func3:
51 # FDATA: 0 [unknown] 0 1 func3 0 1 100
52 .cfi_startproc
53 retq
54 .size func3, .-func3
55 .cfi_endproc
57 .globl func4
58 .type func4,@function
59 func4:
60 # FDATA: 0 [unknown] 0 1 func4 0 1 99
61 .cfi_startproc
62 retq
63 .size func4, .-func4
64 .cfi_endproc
66 .globl func5
67 .type func5,@function
68 func5:
69 # FDATA: 0 [unknown] 0 1 func5 0 1 110
70 .cfi_startproc
71 retq
72 .size func5, .-func5
73 .cfi_endproc