[cfe-users] Need help with llvm gcov c++ coverage

MissionSix via cfe-users cfe-users at lists.llvm.org
Tue Aug 7 21:22:04 PDT 2018


I originally posted this on [llvm-dev] but this is hopefully more relevant.

I have an existing test suite I’m gathering coverage numbers for.  I'm
getting 0% coverage with my C++ code, but the same setup works for C.

I've configured the build framework to set 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 being reported as ran once.  The C tests
code correctly reports coverage for other shared libraries under test.

Here's my compiler version:

  $ clang++ --version
  clang version 3.9.1 (tags/RELEASE_391/final)

I'm wondering if there are any flags or debugging things I can instrument
with the c++ code to find out why the numbers aren't being recorded.

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20180807/ce069162/attachment.html>

More information about the cfe-users mailing list