[PATCH] D121390: [llvm-cov gcov] Fix calculating coverage statistics of template functions

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 14 08:47:13 PDT 2022


ikudrin added inline comments.


================
Comment at: llvm/test/tools/llvm-cov/gcov/tmpl.cpp:14
+int main() {
+  return test<1>(1) +
+    test<1>(2) +
----------------
MaskRay wrote:
> ikudrin wrote:
> > MaskRay wrote:
> > > It's useful to dump `llvm-cov gcov -t` and test the line counts for the three lines, to better leverage this test file.
> > I'm not sure I follow you. The patch fixes and the test checks the coverage statistics for template functions (`-f`), not execution counts (`-t`). 
> I suggest using `llvm-cov gcov -t -f` to better leverage the test. I know this patch fixes an issue. But with little efforts (adding line execution counts for `-t`) this patch can add more coverage that we currently lack (there are very little C++ template tests): `test<1>() + test<2>();` on the same line may be interesting for the line execution counts.
`-t` suppresses `-f`, and a passed source file name is ignored if `--gcno=`/`--gcda=` are specified, so I have to rework the test


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

https://reviews.llvm.org/D121390



More information about the llvm-commits mailing list