1 /* Checks that BOLT correctly processes a user-provided function list file,
2 * reorder functions according to this list, update hot_start and hot_end
3 * symbols and insert a function to perform hot text mapping during program
15 return fib(x
- 1) + fib(x
- 2);
22 int main(int argc
, char **argv
) {
23 printf("fib(%d) = %d\n", argc
, fib(argc
));
28 REQUIRES: system-linux,bolt-runtime
30 RUN: %clang %cflags -no-pie %s -o %t.exe -Wl,-q
32 RUN: llvm-bolt %t.exe --relocs=1 --lite --reorder-functions=user \
33 RUN: --hugify --function-order=%p/Inputs/user_func_order.txt -o %t
34 RUN: llvm-nm --numeric-sort --print-armap %t | \
35 RUN: FileCheck %s -check-prefix=CHECK-NM
36 RUN: %t 1 2 3 | FileCheck %s -check-prefix=CHECK-OUTPUT
38 CHECK-NM: W __hot_start
41 CHECK-NM-NEXT: W __hot_end
43 CHECK-OUTPUT: fib(4) = 3