Skip to content

Commit

Permalink
[Coverage][llvm-cov] Correctly export branch coverage in LCOV format
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fetzerch authored and evodius96 committed Aug 20, 2021
1 parent b8e345b commit 9116211
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions llvm/test/tools/llvm-cov/branch-export-lcov.test
Expand Up @@ -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
Expand Down Expand Up @@ -70,4 +70,4 @@
// MACROS-NOT: BRDA:37
// MACROS-NOT: BRDA
// MACROS: BRF:40
// MACROS: BFH:24
// MACROS: BRH:24
2 changes: 1 addition & 1 deletion llvm/tools/llvm-cov/CoverageExporterLcov.cpp
Expand Up @@ -167,7 +167,7 @@ void renderLineSummary(raw_ostream &OS, const FileCoverageSummary &Summary) {

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,
Expand Down

0 comments on commit 9116211

Please sign in to comment.