[PATCH] D83592: [Parser] Add comment to skipped regions

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 14 12:05:43 PDT 2020


vsk added a comment.

Could you add an end-to-end llvm-cov test (see e.g. compiler-rt/test/profile/Linux/coverage_ctors.cpp)? Here are some important cases I think we should check:

- `/* comment at the start of a line */ expr;`
- `expr; /* comment at the end of a line */`
- `expr; // comment at the end of a line`
- `// comment spanning entire line`

In all but the last case, llvm-cov should report an execution count for the line.



================
Comment at: clang/test/CoverageMapping/break.c:1
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name break.c %s | FileCheck %s
+// RUN: sed 's/\/\/.*//' %s > %T/%basename_t && %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name break.c %T/%basename_t | FileCheck %s
 
----------------
Could you introduce a lit substitution in clang/test/lit.cfg.py for this (say, '%strip_comments'?), so that there's just one copy of the sed command?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83592/new/

https://reviews.llvm.org/D83592





More information about the cfe-commits mailing list