<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_NEW "
title="NEW - Coverage: line count incorrect for single statement for/while loop"
href="https://bugs.llvm.org/show_bug.cgi?id=35387">35387</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Coverage: line count incorrect for single statement for/while loop
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</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>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>eveson.sean@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, vsk@apple.com
</td>
</tr></table>
<p>
<div>
<pre>Hi,
Lines 4 and 6 in the following llvm-cov output are never executed, but have a
count of 1.
1| 1|int main() {
2| 1| int x;
3| 1| while (0)
4| 1| ++x;
5| 1| for (;0;)
6| 1| ++x;
7| 1| return 0;
8| 1|}
The count *is* correct in the following cases:
while (0) {
++x; // Count is 0.
}
for (;0;) {
++x; // Count is 0.
}
if (0)
++x; // Count is 0.
I suspect this is the same issue that was fixed for `if` in r317758
(<a href="https://reviews.llvm.org/rL317758">https://reviews.llvm.org/rL317758</a>).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>