From 9116211d180ca417fa93d4e97e60f4ba849d58d9 Mon Sep 17 00:00:00 2001 From: Christian Fetzer Date: Fri, 20 Aug 2021 13:24:44 -0500 Subject: [PATCH] [Coverage][llvm-cov] Correctly export branch coverage in LCOV format Commit 9f2967bcfe2f7d1fc02281f0098306c90c2c10a5 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 --- llvm/test/tools/llvm-cov/branch-export-lcov.test | 4 ++-- llvm/tools/llvm-cov/CoverageExporterLcov.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/test/tools/llvm-cov/branch-export-lcov.test b/llvm/test/tools/llvm-cov/branch-export-lcov.test index 3e4a300d645d7..1714123ec7be5 100644 --- a/llvm/test/tools/llvm-cov/branch-export-lcov.test +++ b/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 diff --git a/llvm/tools/llvm-cov/CoverageExporterLcov.cpp b/llvm/tools/llvm-cov/CoverageExporterLcov.cpp index 6cf5d9285b90a..0096a3d44d856 100644 --- a/llvm/tools/llvm-cov/CoverageExporterLcov.cpp +++ b/llvm/tools/llvm-cov/CoverageExporterLcov.cpp @@ -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,