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)
23 # FDATA: 0 [unknown] 0 1 main 0 1 400
27 .size _start, .-_start
33 # FDATA: 0 [unknown] 0 1 func1 0 1 500
42 # FDATA: 0 [unknown] 0 1 func2 0 1 1500
51 # FDATA: 0 [unknown] 0 1 func3 0 1 100
60 # FDATA: 0 [unknown] 0 1 func4 0 1 99
69 # FDATA: 0 [unknown] 0 1 func5 0 1 110