aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ProfileData/CoverageMappingTest.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2021-11-16 14:33:10 -0800
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2021-11-16 14:39:30 -0800
commit77898a4c0c8c6d2366909aee4e145b01c534162e (patch)
tree8d41c766012e73834c9f29048e9c34f0002d14d0 /llvm/unittests/ProfileData/CoverageMappingTest.cpp
parentae389b2450bd604a3f3bbe5b09b333b2d99801dd (diff)
downloadllvm-77898a4c0c8c6d2366909aee4e145b01c534162e.zip
llvm-77898a4c0c8c6d2366909aee4e145b01c534162e.tar.gz
llvm-77898a4c0c8c6d2366909aee4e145b01c534162e.tar.bz2
Coverage: Fix iterated type for LineCoverageIterator
LineCoverageIterator is not providing access to a mutable object. Fix it to iterate over `const LineCoverageStats` so that `operator->()` compiles again after 6b9b86db9dd974585a5c71cf2e5231d1e3385f7c.
Diffstat (limited to 'llvm/unittests/ProfileData/CoverageMappingTest.cpp')
-rw-r--r--llvm/unittests/ProfileData/CoverageMappingTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/unittests/ProfileData/CoverageMappingTest.cpp b/llvm/unittests/ProfileData/CoverageMappingTest.cpp
index f6f93cd..cc4c953 100644
--- a/llvm/unittests/ProfileData/CoverageMappingTest.cpp
+++ b/llvm/unittests/ProfileData/CoverageMappingTest.cpp
@@ -693,6 +693,9 @@ TEST_P(CoverageMappingTest, test_line_coverage_iterator) {
++Line;
}
ASSERT_EQ(11U, Line);
+
+ // Check that operator->() works / compiles.
+ ASSERT_EQ(1U, LineCoverageIterator(Data)->getLine());
}
TEST_P(CoverageMappingTest, uncovered_function) {