Files
llvm-project/bolt/test/empty-fdata-file.test
Yashwant Singh 5e14916fa6 Early exit llvm-bolt when coming across empty data files (#176859)
perf2bolt generates empty fdata files for small binaries and right now
BOLT does this check while parsing by calling `((!hasBranchData() &&
!hasMemData()))`. Instead, early exit as soon as the buffer finishes
reading the data file and exit with error message.
2026-04-06 09:37:05 +05:30

13 lines
460 B
Plaintext

## Check that llvm-bolt detects bad profile data and aborts
## This test uses the clang driver without target flags and will only succeed
## on Linux systems where the host triple matches the target.
REQUIRES: system-linux
RUN: %clang %cflags %S/Inputs/hello.c -o %t
RUN: touch %t.empty.fdata
RUN: not llvm-bolt %t -o %t.bolt --data %t.empty.fdata 2>&1 | FileCheck %s
CHECK: WARNING: empty profile data file
CHECK-NEXT: BOLT-ERROR: {{.*}}Input/output error