[llvm] [profdata] Consume reader error if returned early (PR #163671)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 16 11:34:42 PDT 2025
ellishg wrote:
> is it possible to add a small test?
@david-xl we only hit an assert if we early return in one of these places
https://github.com/llvm/llvm-project/blob/68fa9c45f10b13f079a204723407470cba6aa73e/llvm/tools/llvm-profdata/llvm-profdata.cpp#L857-L868
The problem is it is difficult to reproduce these errors in `.profraw` files. The tests `malformed-num-counters-zero.test` and `malformed-ptr-to-counter-array.test` have to manually create `.profraw` files and corrupt them somehow, which involve parsing the byte representation of these files. Ideally we would have some textual representation of `.profraw` files, similar to `.proftext` files. For now, it is pretty difficult to write a test for this.
https://github.com/llvm/llvm-project/pull/163671
More information about the llvm-commits
mailing list