[PATCH] D52034: [Clang] Add options -Xclang -coverage-filter and -Xclang -coverage-exclude to filter the files to instrument with gcov

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 20 16:21:44 PDT 2018


vsk added inline comments.


================
Comment at: test/CodeGen/code-coverage-filter.c:4
+// RUN: %clang_cc1 -emit-llvm -femit-coverage-data -coverage-exclude=.*\\.h %s -o - \
+// RUN:    | FileCheck -check-prefix=NOH %s
+// RUN: %clang_cc1 -emit-llvm -femit-coverage-data -coverage-filter=.*\\.c %s -o - \
----------------
Could you use more descriptive check prefixes here, like 'NO-HEADERS'? Also, if it's possible to use fewer '\' escape tokens by wrapping the regex list in single-quotes, that would make things easier to read.


================
Comment at: test/CodeGen/code-coverage-filter.c:32
+
+// ALL: define i32 @test1(i32 %x) #0 {{.*}}
+// ALL: {{.*}}__llvm_gcov_ctr{{.*}}
----------------
1. This test will break on bots which use 16-bit ints. For simplicity, consider sticking to `void` and getting rid of unnecessary control flow.
2. Is there any need to check '#0'?


Repository:
  rC Clang

https://reviews.llvm.org/D52034





More information about the cfe-commits mailing list