[PATCH] D108358: [llvm-cov] Correctly export branch coverage in LCOV format

Christian Fetzer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 19 02:36:01 PDT 2021


fetzerch created this revision.
fetzerch requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Commit 9f2967bcfe2f7d1fc02281f0098306c90c2c10a5 <https://reviews.llvm.org/rG9f2967bcfe2f7d1fc02281f0098306c90c2c10a5> introduced support for
branch coverage including export to the LCOV format.

This commit corrects the LCOV field name for branches from BFH to BRH.
The mistake seems to have slipped in as typo because the correct field
name BRH is used in the comment section at the beginning of the file.

See also https://github.com/linux-test-project/lcov/blob/d100e6cdd4c67cbe5322fa26b2ee8aa34ea7ebcf/man/geninfo.1#L561
for the LCOV format specification.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108358

Files:
  llvm/test/tools/llvm-cov/branch-export-lcov.test
  llvm/tools/llvm-cov/CoverageExporterLcov.cpp


Index: llvm/tools/llvm-cov/CoverageExporterLcov.cpp
===================================================================
--- llvm/tools/llvm-cov/CoverageExporterLcov.cpp
+++ llvm/tools/llvm-cov/CoverageExporterLcov.cpp
@@ -167,7 +167,7 @@
 
 void renderBranchSummary(raw_ostream &OS, const FileCoverageSummary &Summary) {
   OS << "BRF:" << Summary.BranchCoverage.getNumBranches() << '\n'
-     << "BFH:" << Summary.BranchCoverage.getCovered() << '\n';
+     << "BRH:" << Summary.BranchCoverage.getCovered() << '\n';
 }
 
 void renderFile(raw_ostream &OS, const coverage::CoverageMapping &Coverage,
Index: llvm/test/tools/llvm-cov/branch-export-lcov.test
===================================================================
--- llvm/test/tools/llvm-cov/branch-export-lcov.test
+++ llvm/test/tools/llvm-cov/branch-export-lcov.test
@@ -34,7 +34,7 @@
 // CHECK-DAG: BRDA:53,0,1,5
 // CHECK-NOT: BRDA
 // CHECK: BRF:30
-// CHECK: BFH:26
+// CHECK: BRH:26
 
 // Check recursive macro-expansions.
 // RUN: llvm-profdata merge %S/Inputs/branch-macros.proftext -o %t.profdata
@@ -70,4 +70,4 @@
 // MACROS-NOT: BRDA:37
 // MACROS-NOT: BRDA
 // MACROS: BRF:40
-// MACROS: BFH:24
+// MACROS: BRH:24


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108358.367436.patch
Type: text/x-patch
Size: 1186 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210819/f7497d10/attachment.bin>


More information about the llvm-commits mailing list