Open dothebart opened 8 months ago
--coverage
/ GCOV_PREFIX
is for GCOV style code coverage, based on debug info.
-fprofile-instr-generate -fcoverage-mapping -mllvm -runtime-counter-relocation
are for https://clang.llvm.org/docs/SourceBasedCodeCoverage.html
The two are independent implementations and generally not supposed to be used together. GCOV_PREFIX
does not control the output directory of SourceBasedCodeCoverage
I've chosen a minimal project with cmake to demonstrate this. My Host is a debian bookworm, however in ubuntu docker containers clang-16 has shown similar behaviour.
The version of the compiler:
And its set up as the default compiler:
along with:
Now the instructions to generate a small c++ project within this environment:
It seems that without
--coverage
in the argumentsstrings
shows a binary containingGCOV_PREFIX
, however, the functionality doesn't seem to be enabled, no profile is collected with the information specified above.And then try to merge the two profile sets demonstrates the error:
I've seen https://github.com/llvm/llvm-project/issues/50966 but am not sure whether its related.