llvm-project/bolt/test/max-funcs.test
Maksim Panchenko c4e60a7f60 [BOLT] Fix --max-funcs=<N> option
Fix off-by-one error while handling of the --max-funcs=<N> option.
We used to process N+1 functions when N was requested.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D152751
2023-06-12 16:54:14 -07:00

14 lines
437 B
Plaintext

## Check that --max-funcs=<N> option works properly in llvm-bolt,
## resulting in processing of no more than N functions in the binary.
REQUIRES: system-linux
RUN: %clangxx %p/Inputs/bolt_icf.cpp -g -Wl,-q -o %t.exe
RUN: llvm-bolt %t.exe --relocs -o %t --max-funcs=2
RUN: llvm-objdump -d -j .text %t | FileCheck %s
## Check that there are only two functions in the dump of .text
CHECK: <{{.*}}>:
CHECK: <{{.*}}>:
CHECK-NOT: <{{.*}}>: