void if_else(bool flag) {
if (flag) { // CHECK: [[@LINE]]|{{ +}}2|
return; // CHECK: [[@LINE]]|{{ +}}1|
- } else { // CHECK: [[@LINE]]|{{ +}}2|
+ } else { // CHECK: [[@LINE]]|{{ +}}1|
return; // CHECK: [[@LINE]]|{{ +}}1|
} // CHECK: [[@LINE]]|{{ +}}1|
}
return;
// Pick the max count from the non-gap, region entry segments. If there
- // aren't any, use the wrapepd count.
- if (HasMultipleRegions) {
- for (const auto *LS : LineSegments)
- if (isStartOfRegion(LS))
- ExecutionCount = std::max(ExecutionCount, LS->Count);
+ // aren't any, use the wrapped count.
+ if (!MinRegionCount) {
+ ExecutionCount = WrappedSegment->Count;
return;
}
- ExecutionCount =
- (MinRegionCount == 1) ? LineSegments[0]->Count : WrappedSegment->Count;
+ for (const auto *LS : LineSegments)
+ if (isStartOfRegion(LS))
+ ExecutionCount = std::max(ExecutionCount, LS->Count);
}
LineCoverageIterator &LineCoverageIterator::operator++() {