[llvm-bugs] [Bug 46660] New: line coverage doesn't show coverage of line after #endif

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 9 10:27:23 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46660

            Bug ID: 46660
           Summary: line coverage doesn't show coverage of line after
                    #endif
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zequanwu at google.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

$ 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.

-- 
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/20200709/a21ee1d4/attachment.html>


More information about the llvm-bugs mailing list