https://bugs.llvm.org/show_bug.cgi?id=37102
Bug ID: 37102
Summary: [LLVM-COV] Wrong coverage with the comparison of
extern function pointer and NULL
Product: Runtime Libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: libprofile library
Assignee: unassignedb...@nondot.org
Reporter: yangyib...@nju.edu.cn
CC: llvm-bugs@lists.llvm.org
$ cat small.c
#include <stdlib.h>
extern int (*_Unwind_RaiseException) (void *) __attribute__((weak));
int main(void)
{
if (&_Unwind_RaiseException != NULL)
return 0;
return 1;
}
$ clang -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| |#include <stdlib.h>
2| |
3| |extern int (*_Unwind_RaiseException) (void *)
__attribute__((weak));
4| |
5| |int main(void)
6| 1|{
7| 1| if (&_Unwind_RaiseException != NULL)
8| 1| return 0;
9| 1| return 1;
10| 1|}
Line #8 is wrongly marked as executed.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs