<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] Macro argument in non-executed if block incorrectly marked as executed"
href="https://bugs.llvm.org/show_bug.cgi?id=43672">43672</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[LLVM-COV] Macro argument in non-executed if block incorrectly marked as executed
</td>
</tr>
<tr>
<th>Product</th>
<td>Runtime Libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>9.0
</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>libprofile library
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>hannes.franke@smartoptics.de
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>$ clang++-9 -v
clang version 9.0.0-svn374193-1~exp1~20191009183050.56 (branches/release_90)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Selected multilib: .;@m64
$ cat macro.cpp
#include <iostream>
#define NOT_CALLED(x) std::cout << (x) << std::endl
int main() {
if (false)
NOT_CALLED("macro argument");
if (false) {
NOT_CALLED("macro argument");
}
}
$ clang++-9 -O0 -g -fcoverage-mapping -fprofile-instr-generate=macro.profraw
macro.cpp && ./a.out && llvm-profdata-9 merge macro.profraw -o macro.profdata
&& llvm-cov-9 show -instr-profile macro.profdata ./a.out
1| |#include <iostream>
2| |
3| 0|#define NOT_CALLED(x) <red>std::cout << (x) << std::endl</red>
4| |
5| 1|int main() {
6| 1| if (false)
7| 1| <red>NOT_CALLED</red>("macro argument");
8| 1|
9| 1| if (false) <red>{
10| 0| NOT_CALLED("macro argument");
11| 0| }</red>
12| 1|}
Everything between '<red></red>' is colored red. If not using curly braces the
macro argument (and therefore the whole line) is marked as executed.</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>