[llvm-bugs] [Bug 37043] New: [LLVM-COV] A no side-effect const statement is wrongly marked as executed when it is after a executed break statement in llvm-cov
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat Apr 7 02:15:44 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=37043
Bug ID: 37043
Summary: [LLVM-COV] A no side-effect const statement is wrongly
marked as executed when it is after a executed break
statement in llvm-cov
Product: Runtime Libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: libprofile library
Assignee: unassignedbugs at nondot.org
Reporter: yangyibiao at nju.edu.cn
CC: llvm-bugs at lists.llvm.org
$ clang -v
clang version 7.0.0- (trunk)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.5
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.4.1
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.4.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.2.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8.0.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.4.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.2.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8.0.0
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8.0.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
$ cat small.c
void main() {
for (;;) {
if (0)
break;
break;
1;
}
}
$ clang -w -O0 -g -fcoverage-mapping -fprofile-instr-generate=small.profraw
small.c; ./a.out; llvm-profdata merge small.profraw -o small.profdata; llvm-cov
show a.out -instr-profile=small.profdata small.c > small.gcov; cat small.gcov
1| 1|void main() {
2| 1| for (;;) {
3| 1| if (0)
4| 0| break;
5| 1| break;
6| 1| 1;
7| 0| }
8| 1|}
*********
Line #6 is wrongly 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/20180407/312855ef/attachment.html>
More information about the llvm-bugs
mailing list