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-phi...@ti.com
          Reporter: a-phi...@ti.com
                CC: htmldevelo...@gmail.com, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to