<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 - llvm-cov: the '||' operator in an assign statement lead to the statement marked as unexecuted"
href="https://bugs.llvm.org/show_bug.cgi?id=33465">33465</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>llvm-cov: the '||' operator in an assign statement lead to the statement marked as unexecuted
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>4.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>yangyibiao@nju.edu.cn
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Left part of the '||' operator in an assign statement is executed but the right
part is not executed.
This will lead the assign statement being marked as unexecuted in the llvm-cov.
$ clang-5.0 -O0 -fcoverage-mapping -fprofile-instr-generate=small.profraw
small.c -o small
$ llvm-profdata-5.0 merge -o small.profdata small.profraw
$ llvm-cov-5.0 show small -instr-profile=small.profdata small.c > small.gcov
/* small.c */
$ cat small.c
void main()
{
int g, v = 1;
g = v || !v;
return;
}
/* small.gcov */
$ cat small.gcov
1| |void main()
2| 1|{
3| 1| int g, v = 1;
4| 0| g = v || !v;
5| 1| return;
6| 1|}</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>