Skip to content

Commit c9afa3a

Browse files
fetzerchtstellar
authored andcommitted
[Coverage][llvm-cov] Correctly export branch coverage in LCOV format
Commit 9f2967b 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. Differential Revision: https://reviews.llvm.org/D108358 (cherry picked from commit 9116211)
1 parent e8ce80e commit c9afa3a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/test/tools/llvm-cov/branch-export-lcov.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
// CHECK-DAG: BRDA:53,0,1,5
3535
// CHECK-NOT: BRDA
3636
// CHECK: BRF:30
37-
// CHECK: BFH:26
37+
// CHECK: BRH:26
3838

3939
// Check recursive macro-expansions.
4040
// RUN: llvm-profdata merge %S/Inputs/branch-macros.proftext -o %t.profdata
@@ -70,4 +70,4 @@
7070
// MACROS-NOT: BRDA:37
7171
// MACROS-NOT: BRDA
7272
// MACROS: BRF:40
73-
// MACROS: BFH:24
73+
// MACROS: BRH:24

llvm/tools/llvm-cov/CoverageExporterLcov.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ void renderLineSummary(raw_ostream &OS, const FileCoverageSummary &Summary) {
167167

168168
void renderBranchSummary(raw_ostream &OS, const FileCoverageSummary &Summary) {
169169
OS << "BRF:" << Summary.BranchCoverage.getNumBranches() << '\n'
170-
<< "BFH:" << Summary.BranchCoverage.getCovered() << '\n';
170+
<< "BRH:" << Summary.BranchCoverage.getCovered() << '\n';
171171
}
172172

173173
void renderFile(raw_ostream &OS, const coverage::CoverageMapping &Coverage,

0 commit comments

Comments
 (0)