mirror-llvm-project/bolt/test/merge-fdata-skip-truncated.test
YongKang Zhu 143664fcd3
[BOLT][merge-fdata] Skip truncated lines in raw profile data (#183187)
Raw profile data file may contain lines truncated due to unexpected
app exit. This change is to have merge_fdata check number of fields
in each line of raw profile data file and ignore a line if the number
is not expected.
2026-02-25 21:42:30 -08:00

20 lines
538 B
Text

## Check that merge-fdata skips truncated lines with a warning
# REQUIRES: system-linux
# RUN: split-file %s %t
# RUN: merge-fdata %t/a.fdata %t/b.fdata -o %t/merged.fdata 2>&1 | \
# RUN: FileCheck -check-prefix=CHECK-WARN %s
# RUN: FileCheck %s --input-file %t/merged.fdata
# CHECK-WARN: WARNING: {{.*}}b.fdata: ignoring malformed entry
## Only the valid entry should appear in the merged output
# CHECK: 1 main 0 1 main 2 1 3
# CHECK-NOT: trunc
#--- a.fdata
1 main 0 1 main 2 0 1
#--- b.fdata
1 main 0 1 main 2 1 2
1 trunc 0 1