You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Line #14 is a label. The goto statement is not executed. However, it was wrongly marked as executed in llvm-cov. While removing Line #10 and #11 from this code, this result is correct.
The text was updated successfully, but these errors were encountered:
Extended Description
$ clang -v
clang version 6.0.0-svn318792-1~exp1 (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/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.3.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/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.3.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
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
$ cat small.c
int main()
{
int i=1, j=1, k=1;
if (i > 0) {
if (j == 1) {
if (k == 1)
return 0;
else
goto lbl;
} else {
;
}
}
lbl:
return 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| |int main()
2| 1|{
3| 1| int i=1, j=1, k=1;
4| 1| if (i > 0) {
5| 1| if (j == 1) {
6| 1| if (k == 1)
7| 1| return 0;
8| 0| else
9| 0| goto lbl;
10| 0| } else {
11| 0| ;
12| 0| }
13| 1| }
14| 1|lbl:
15| 0| return 1;
16| 0|}
Line #14 is a label. The goto statement is not executed. However, it was wrongly marked as executed in llvm-cov. While removing Line #10 and #11 from this code, this result is correct.
The text was updated successfully, but these errors were encountered: