diff options
author | Vedant Kumar <vsk@apple.com> | 2016-09-19 00:38:23 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-09-19 00:38:23 +0000 |
commit | 016111f7b98ef31f22a0ec95d7d0b0237b5f2176 (patch) | |
tree | cfb5e7b48d92510f338175d97b9ea8e0d6cadee1 /llvm/test/tools/llvm-cov/report.cpp | |
parent | 673ad727cdb19956b94c8f8964b862ebe50bd16a (diff) | |
download | bcm5719-llvm-016111f7b98ef31f22a0ec95d7d0b0237b5f2176.tar.gz bcm5719-llvm-016111f7b98ef31f22a0ec95d7d0b0237b5f2176.zip |
[llvm-cov] Track function and instantiation coverage separately
These are distinct statistics which are useful to look at separately.
Example: say you have a template function "foo" with 5 instantiations
and only 3 of them are covered. Then this contributes (1/1) to the total
function coverage and (3/5) to the total instantiation coverage. I.e,
the old "Function Coverage" column has been renamed to "Instantiation
Coverage", and the new "Function Coverage" aggregates information from
the various instantiations of a function.
One benefit of making this switch is that the Line and Region coverage
columns will start making sense. Let's continue the example and assume
that the 5 instantiations of "foo" cover {2, 4, 6, 8, 10} out of 10
lines respectively. The new line coverage for "foo" is (10/10), not
(30/50). The old scenario got confusing because we'd report that there
were more lines in a file than what was actually possible.
llvm-svn: 281875
Diffstat (limited to 'llvm/test/tools/llvm-cov/report.cpp')
-rw-r--r-- | llvm/test/tools/llvm-cov/report.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/tools/llvm-cov/report.cpp b/llvm/test/tools/llvm-cov/report.cpp index e8563271dac..824442f99c4 100644 --- a/llvm/test/tools/llvm-cov/report.cpp +++ b/llvm/test/tools/llvm-cov/report.cpp @@ -1,11 +1,11 @@ // RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence 2>&1 | FileCheck %s // RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence report.cpp 2>&1 | FileCheck -check-prefix=FILT-NEXT %s -// CHECK: Filename Regions Missed Regions Cover Functions Missed Functions Executed Lines Missed Lines Cover +// CHECK: Regions Missed Regions Cover Functions Missed Functions Executed Instantiations Missed Insts. Executed Lines Missed Lines Cover // CHECK-NEXT: --- -// CHECK-NEXT: report.cpp 5 2 60.00% 4 1 75.00% 13 4 69.23% +// CHECK-NEXT: report.cpp 5 2 60.00% 4 1 75.00% 4 1 75.00% 13 4 69.23% // CHECK-NEXT: --- -// CHECK-NEXT: TOTAL 5 2 60.00% 4 1 75.00% 13 4 69.23% +// CHECK-NEXT: TOTAL 5 2 60.00% 4 1 75.00% 4 1 75.00% 13 4 69.23% // FILT: File 'report.cpp': // FILT-NEXT: Name Regions Miss Cover Lines Miss Cover |