[all-commits] [llvm/llvm-project] 448f50: [llvm-cov] Add failing test for gap region line co...
Maksim Levental via All-commits
all-commits at lists.llvm.org
Sat Jun 13 21:53:54 PDT 2026
Branch: refs/heads/users/makslevental/inline-excl-llvm-cov-v2
Home: https://github.com/llvm/llvm-project
Commit: 448f50d3a42409185494823d52b8837984ce76c1
https://github.com/llvm/llvm-project/commit/448f50d3a42409185494823d52b8837984ce76c1
Author: makslevental <maksim.levental at gmail.com>
Date: 2026-06-13 (Sat, 13 Jun 2026)
Changed paths:
A llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk-v2.cpp
A llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.covmapping
A llvm/test/tools/llvm-cov/Inputs/gap-region-quirk/gap-quirk.profdata
A llvm/test/tools/llvm-cov/gap-region-line-coverage.test
Log Message:
-----------
[llvm-cov] Add failing test for gap region line coverage bug
LineCoverageStats incorrectly reports lines as uncovered when a gap
region with count=0 wraps into a line that has non-entry segments
with count > 0.
The test uses a minimal reproducer: a scoped block with a never-taken
early return followed by a statement. The closing "}" produces a gap
region that wraps to the next line, suppressing its execution count.
The extra statement after the if-block is required — without it,
clang emits a region entry (MinRegionCount > 0) and the bug doesn't
trigger.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
Commit: 4d50e944ceb811fbe2c0ee4528f4c9e08a5a98a0
https://github.com/llvm/llvm-project/commit/4d50e944ceb811fbe2c0ee4528f4c9e08a5a98a0
Author: makslevental <m_levental at apple.com>
Date: 2026-06-13 (Sat, 13 Jun 2026)
Changed paths:
M llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
Log Message:
-----------
[llvm-cov] Fix undercounting lines wrapped by gap regions
Lines with no region entry that are wrapped by a gap region were
reported with the gap's count (often 0), even when non-gap segments
on the line indicated the line was actually executed. This caused
llvm-cov to undercount coverage for lines that continue a covered
region after a gap (e.g., closing braces, simple statements following
an if/else).
Check for non-gap segments with HasCount on such lines and use their
max count instead of the gap region's count.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
Compare: https://github.com/llvm/llvm-project/compare/448f50d3a424%5E...4d50e944ceb8
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list