llvm-gcov reporting 0% coverage for c++ tests only


Thanks for making an awesome tool chain! I have a question my normal paths of information are leading me to dead ends, so I turn here.

I have an existing test suite I’m attempting to analyze coverage numbers with, using a build framework that sets the compilation flags as follows:

clang++ -g -O2 -fprofile-arcs -ftest-coverage …

The suite is a mixture of C and C++ code, and when I run lcov to generate a report, the c++ tests are mostly reporting 0% coverage. I say mostly because of static initializers. The C tests code correctly reports coverage for other shared libraries.

Here’s my compiler version:

$ clang++ --version
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-unknown-freebsd12.0
Thread model: posix

Any help would be appreciated, this is driving me nuts.