[llvm-bugs] [Bug 43672] New: [LLVM-COV] Macro argument in non-executed if block incorrectly marked as executed
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Oct 14 04:42:16 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=43672
Bug ID: 43672
Summary: [LLVM-COV] Macro argument in non-executed if block
incorrectly marked as executed
Product: Runtime Libraries
Version: 9.0
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: libprofile library
Assignee: unassignedbugs at nondot.org
Reporter: hannes.franke at smartoptics.de
CC: llvm-bugs at lists.llvm.org
$ 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.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191014/cb77cd28/attachment.html>
More information about the llvm-bugs
mailing list