[llvm-bugs] [Bug 50394] New: [LLVM-COV] Fix branch coverage merging across function instantiations

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 18 13:19:53 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50394

            Bug ID: 50394
           Summary: [LLVM-COV] Fix branch coverage merging across function
                    instantiations
           Product: new-bugs
           Version: 12.0
          Hardware: All
                OS: All
            Status: CONFIRMED
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: a-phipps at ti.com
          Reporter: a-phipps at ti.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org
            Blocks: 49317

When I made the upstream commit for branch coverage support in code-coverage in
January, I made an incorrect assumption that branch coverage numbers (covered
branch and total branches) should be accumulated across function
instantiations. This is not what is done for lines and regions, where the
maximum line/region coverage found in a function instantiation across an
instantiation group is returned. For example, if a function template definition
has 2 total branches, the branch coverage would be reported as an accumulated
total across all instantiations (8 total branches across 4 instantiations).

The correct assumption for the FunctionCoverageSummary::get(const
InstantiationGroup &Group, ...) routine is that the summary it returns should
agree with the function definition in the source code on lines, regions, and
branches. So we should do the same thing for branch coverage as we do for line
and region coverage. If a function template definition has 2 total branches,
the summary should also reflect branch coverage for 2 total branches.

Code Review for fix:
https://reviews.llvm.org/D102193

Main branch commit for fix:
https://reviews.llvm.org/rGeccb925147d5f262a3e74cc050d0665dd4e6d8db

This fix needs to be applied to the 12.x release branch.


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=49317
[Bug 49317] [meta] 12.0.1 Release Blockers
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210518/62aa6578/attachment-0001.html>


More information about the llvm-bugs mailing list