mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
Revert "[llvm-cov] reset executation count to 0 after wrapped segment"
This reverts D85036 Differential Revision: https://reviews.llvm.org/D98084
This commit is contained in:
parent
0693f65f6c
commit
801d7bdaee
@ -794,7 +794,6 @@ LineCoverageStats::LineCoverageStats(
|
||||
ExecutionCount = WrappedSegment->Count;
|
||||
if (!MinRegionCount)
|
||||
return;
|
||||
ExecutionCount = 0;
|
||||
for (const auto *LS : LineSegments)
|
||||
if (isStartOfRegion(LS))
|
||||
ExecutionCount = std::max(ExecutionCount, LS->Count);
|
||||
|
@ -12,7 +12,7 @@ template <class T> T FOO<T>::DoIt(T ti) { // HEADER: [[@LINE]]| 2|template
|
||||
for (T I = 0; I < ti; I++) { // HEADER: [[@LINE]]| 22| for (T
|
||||
t += I; // HEADER: [[@LINE]]| 20| t += I;
|
||||
if (I > ti / 2) // HEADER: [[@LINE]]| 20| if (I > ti
|
||||
t -= 1; // HEADER: [[@LINE]]| 8| t -= 1;
|
||||
t -= 1; // HEADER: [[@LINE]]| 20| t -= 1;
|
||||
} // HEADER: [[@LINE]]| 20| }
|
||||
// HEADER: [[@LINE]]| 2|
|
||||
return t; // HEADER: [[@LINE]]| 2| return t;
|
||||
|
@ -118,18 +118,18 @@
|
||||
// REPORT-NEXT: ---
|
||||
// REPORT-NEXT: simple_loops 8 0 100.00% 9 0 100.00% 6 0 100.00%
|
||||
// REPORT-NEXT: conditionals 24 0 100.00% 15 0 100.00% 16 2 87.50%
|
||||
// REPORT-NEXT: early_exits 20 4 80.00% 25 3 88.00% 16 6 62.50%
|
||||
// REPORT-NEXT: jumps 39 12 69.23% 48 4 91.67% 26 9 65.38%
|
||||
// REPORT-NEXT: switches 28 5 82.14% 38 5 86.84% 30 9 70.00%
|
||||
// REPORT-NEXT: early_exits 20 4 80.00% 25 2 92.00% 16 6 62.50%
|
||||
// REPORT-NEXT: jumps 39 12 69.23% 48 2 95.83% 26 9 65.38%
|
||||
// REPORT-NEXT: switches 28 5 82.14% 38 4 89.47% 30 9 70.00%
|
||||
// REPORT-NEXT: big_switch 25 1 96.00% 32 0 100.00% 30 6 80.00%
|
||||
// REPORT-NEXT: boolean_operators 16 0 100.00% 13 0 100.00% 22 2 90.91%
|
||||
// REPORT-NEXT: boolop_loops 19 0 100.00% 14 0 100.00% 16 2 87.50%
|
||||
// REPORT-NEXT: conditional_operator 4 2 50.00% 8 1 87.50% 4 2 50.00%
|
||||
// REPORT-NEXT: conditional_operator 4 2 50.00% 8 0 100.00% 4 2 50.00%
|
||||
// REPORT-NEXT: do_fallthrough 9 0 100.00% 12 0 100.00% 6 0 100.00%
|
||||
// REPORT-NEXT: main 1 0 100.00% 16 0 100.00% 0 0 0.00%
|
||||
// REPORT-NEXT: c-general.c:static_func 4 0 100.00% 4 0 100.00% 2 0 100.00%
|
||||
// REPORT-NEXT: ---
|
||||
// REPORT-NEXT: TOTAL 197 24 87.82% 234 13 94.44% 174 38 78.16%
|
||||
// REPORT-NEXT: TOTAL 197 24 87.82% 234 8 96.58% 174 38 78.16%
|
||||
|
||||
// Test file-level report.
|
||||
// RUN: llvm-profdata merge %S/Inputs/branch-c-general.proftext -o %t.profdata
|
||||
@ -157,7 +157,7 @@
|
||||
// HTML-INDEX: <td class='column-entry-green'>
|
||||
// HTML-INDEX: 100.00% (12/12)
|
||||
// HTML-INDEX: <td class='column-entry-yellow'>
|
||||
// HTML-INDEX: 94.44% (221/234)
|
||||
// HTML-INDEX: 96.58% (226/234)
|
||||
// HTML-INDEX: <td class='column-entry-yellow'>
|
||||
// HTML-INDEX: 87.82% (173/197)
|
||||
// HTML-INDEX: <td class='column-entry-red'>
|
||||
|
@ -84,7 +84,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// REPORT: Name Regions Miss Cover Lines Miss Cover Branches Miss Cover
|
||||
// REPORT-NEXT: ---
|
||||
// REPORT-NEXT: _Z4funcii 77 9 88.31% 68 10 85.29% 80 32 60.00%
|
||||
// REPORT-NEXT: _Z4funcii 77 9 88.31% 68 3 95.59% 80 32 60.00%
|
||||
// REPORT-NEXT: main 1 0 100.00% 5 0 100.00% 0 0 0.00%
|
||||
// REPORT-NEXT: ---
|
||||
// REPORT-NEXT: TOTAL 78 9 88.46% 73 10 86.30% 80 32 60.00%
|
||||
// REPORT-NEXT: TOTAL 78 9 88.46% 73 3 95.89% 80 32 60.00%
|
||||
|
@ -20,6 +20,6 @@
|
||||
// REPORT-NOT: do_fallthrough 9 0 100.00% 12 0 100.00% 6 0 100.00%
|
||||
// REPORT-NOT: main 1 0 100.00% 16 0 100.00% 0 0 0.00%
|
||||
// REPORT-NOT: c-general.c:static_func 4 0 100.00% 4 0 100.00% 2 0 100.00%
|
||||
// REPORT: TOTAL 197 24 87.82% 234 13 94.44%
|
||||
// REPORT: TOTAL 197 24 87.82% 234 8 96.58%
|
||||
// REPORT-NOT: TOTAL 197 24 87.82% 234 13 94.44% 174 38 78.16%
|
||||
|
||||
|
@ -22,7 +22,7 @@ REPORT_IGNORE_DIR-NOT: {{.*}}extra{{[/\\]}}dec.h{{.*}}
|
||||
REPORT_IGNORE_DIR-NOT: {{.*}}extra{{[/\\]}}inc.h{{.*}}
|
||||
REPORT_IGNORE_DIR: {{.*}}abs.h{{.*}}
|
||||
REPORT_IGNORE_DIR: {{.*}}main.cc{{.*}}
|
||||
REPORT_IGNORE_DIR: {{^}}TOTAL 5{{.*}}90.00%{{$}}
|
||||
REPORT_IGNORE_DIR: {{^}}TOTAL 5{{.*}}100.00%{{$}}
|
||||
|
||||
# Ignore all files from "extra" directory even when SOURCES specified.
|
||||
RUN: llvm-cov report -instr-profile %S/Inputs/sources_specified/main.profdata \
|
||||
@ -35,7 +35,7 @@ REPORT_IGNORE_DIR_WITH_SOURCES-NOT: {{.*}}extra{{[/\\]}}dec.h{{.*}}
|
||||
REPORT_IGNORE_DIR_WITH_SOURCES-NOT: {{.*}}extra{{[/\\]}}inc.h{{.*}}
|
||||
REPORT_IGNORE_DIR_WITH_SOURCES-NOT: {{.*}}main.cc{{.*}}
|
||||
REPORT_IGNORE_DIR_WITH_SOURCES: {{.*}}abs.h{{.*}}
|
||||
REPORT_IGNORE_DIR_WITH_SOURCES: {{^}}TOTAL 4{{.*}}80.00%{{$}}
|
||||
REPORT_IGNORE_DIR_WITH_SOURCES: {{^}}TOTAL 4{{.*}}100.00%{{$}}
|
||||
|
||||
########################
|
||||
# Test "show" command.
|
||||
|
@ -680,7 +680,7 @@ TEST_P(CoverageMappingTest, test_line_coverage_iterator) {
|
||||
CoverageData Data = LoadedCoverage->getCoverageForFile("file1");
|
||||
|
||||
unsigned Line = 0;
|
||||
unsigned LineCounts[] = {20, 20, 20, 20, 10, 10, 10, 10, 10, 0, 0};
|
||||
unsigned LineCounts[] = {20, 20, 20, 20, 30, 10, 10, 10, 10, 0, 0};
|
||||
for (const auto &LCS : getLineCoverageStats(Data)) {
|
||||
ASSERT_EQ(Line + 1, LCS.getLine());
|
||||
errs() << "Line: " << Line + 1 << ", count = " << LCS.getExecutionCount() << "\n";
|
||||
|
Loading…
Reference in New Issue
Block a user