Hello,
I am exploring to improve code coverage in LLVM/Clang and locally replicating:
https://lab.llvm.org/coverage/coverage-reports/coverage/Users/buildslave/jenkins/workspace/coverage/llvm-project/index.html
Commands used:
mkdir llvm-project/build
cd llvm-project/build
CC=‘clang’ CXX=‘clang++’ cmake -DLLVM_ENABLE_PROJECTS=“clang;llvm;polly;lld” -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_SANITIZER=Address -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_BUILD_INSTRUMENTED_COVERAGE=On -G “Unix Makefiles” …/llvm
make
Test 1: Execute clang test and generate code coverage report in my-coverage-output-dir_clang
make check-clang
python /llvm/utils/prepare-code-coverage-artifact.py --preserve-profiles -C build $(which llvm-profdata) $(which llvm-cov) build/profiles my-coverage-output-dir_clang build/bin/clang
Totals: 59.32% (101503/171118) 82.34% (5325178/6467207) 60.92% (1453672/2386306) 54.35% (977326/1798080)
Test 2: Execute llvm test and generate code coverage report in my-coverage-output-dir_llvm
make check-llvm
python /llvm/utils/prepare-code-coverage-artifact.py --preserve-profiles -C build $(which llvm-profdata) $(which llvm-cov) build/profiles my-coverage-output-dir_llvm build/bin/clang
Totals: 59.33% (101517/171111) 82.35% (5325561/6467190) 60.93% (1454028/2386299) 54.38% (977823/1798080)
After we execute both tests and generate code coverage one-after-another, we see almost same coverage values for Function coverage, Line coverage, Region Coverage and Branch Coverage.
Any suggestions how to fix this?
Thanks and Regards,
Vrukesh