llvm-project/bolt/test/print-only.test
YongKang Zhu ac6daa8181
[BOLT][print] Add option '--print-only-file' (NFC) (#168023)
With this option we can pass to BOLT names of functions to be printed
through a file instead of specifying them all on command line.
2025-11-14 10:26:21 -08:00

26 lines
988 B
Plaintext

# Verify if `--print-only` and `--print-only-files` work fine.
# REQUIRES: system-linux
# RUN: %clang %cflags -x c %p/Inputs/bolt_icf.cpp -o %t -Wl,-q
# RUN: llvm-bolt %t -o %t.bolt --icf=none --print-cfg \
# RUN: --print-only=foo.*,bar.*,main.* 2>&1 | FileCheck %s
# RUN: echo "bar.*" > %t.pof
# RUN: echo "main.*" >> %t.pof
# RUN: llvm-bolt %t -o %t.bolt --icf=none --print-cfg \
# RUN: --print-only=foo.* --print-only-file=%t.pof \
# RUN: 2>&1 | FileCheck %s
# RUN: echo "foo.*" >> %t.pof
# RUN: llvm-bolt %t -o %t.bolt --icf=none --print-cfg \
# RUN: --print-only-file=%t.pof 2>&1 | FileCheck %s
# CHECK-NOT: Binary Function "fiz" after building cfg
# CHECK-NOT: Binary Function "faz" after building cfg
# CHECK-NOT: Binary Function "zip" after building cfg
# CHECK-NOT: Binary Function "zap" after building cfg
# CHECK: Binary Function "foo" after building cfg
# CHECK: Binary Function "bar" after building cfg
# CHECK: Binary Function "main" after building cfg