<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_CONFIRMED "
title="CONFIRMED - [LLVM-COV] Fix branch coverage merging across function instantiations"
href="https://bugs.llvm.org/show_bug.cgi?id=50394">50394</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[LLVM-COV] Fix branch coverage merging across function instantiations
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>12.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>CONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>a-phipps@ti.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>a-phipps@ti.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Blocks</th>
<td>49317
</td>
</tr></table>
<p>
<div>
<pre>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:
<a href="https://reviews.llvm.org/D102193">https://reviews.llvm.org/D102193</a>
Main branch commit for fix:
<a href="https://reviews.llvm.org/rGeccb925147d5f262a3e74cc050d0665dd4e6d8db">https://reviews.llvm.org/rGeccb925147d5f262a3e74cc050d0665dd4e6d8db</a>
This fix needs to be applied to the 12.x release branch.</pre>
</div>
</p>
<div id="referenced">
<hr style="border: 1px dashed #969696">
<b>Referenced Bugs:</b>
<ul>
<li>
[<a class="bz_bug_link
bz_status_NEW "
title="NEW - [meta] 12.0.1 Release Blockers"
href="https://bugs.llvm.org/show_bug.cgi?id=49317">Bug 49317</a>] [meta] 12.0.1 Release Blockers
</li>
</ul>
</div>
<br>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>