llvm-project
llvm-project copied to clipboard
line coverage doesn't show coverage of line after #endif
| Bugzilla Link | 46660 |
| Resolution | FIXED |
| Resolved on | Jul 10, 2020 11:46 |
| Version | trunk |
| OS | Linux |
| CC | @dwblaikie,@zygoloid |
Extended Description
$ cat /tmp/a.c int main() { int i = 0; #ifdef MACRO int x = i; #endif return i; }
$ clang -fcoverage-mapping -fprofile-instr-generate /tmp/a.c -Xclang -dump-coverage-mapping && ./a.out && llvm-profdata merge -sparse default.profraw -o a.profdata && llvm-cov show ./a.out -instr-profile=a.profdata main: File 0, 1:12 -> 7:2 = #0 Skipped,File 0, 3:1 -> 6:1 = 0 1| 1|int main() { 2| 1| int i = 0; 3| |#ifdef MACRO 4| | int x = i; 5| |#endif 6| | return i; 7| 1|}
line 6 is shown as not tracked.
Fixed at https://reviews.llvm.org/rGdcd76c0c0716a4417110423718c7cae4b516b4d0