Skip to content

Avoid need for SLocEntryLoaded BitVector #67960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions llvm/unittests/ADT/PagedVectorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,20 @@ TEST(PagedVectorTest, FillNonTrivialConstructor) {
EXPECT_EQ(std::distance(V.materialized_begin(), V.materialized_end()), 10LL);
}

// Test that isMaterialized returns true for all the elements
// of the page, not only the one that was accessed.
TEST(PagedVectorTest, IsMaterialized) {
PagedVector<int, 10> V;
V.resize(20);
EXPECT_EQ(V.isMaterialized(0), false);
EXPECT_EQ(V.isMaterialized(1), false);
EXPECT_EQ(V.isMaterialized(10), false);
V[0] = 0;
EXPECT_EQ(V.isMaterialized(0), true);
EXPECT_EQ(V.isMaterialized(1), true);
EXPECT_EQ(V.isMaterialized(10), false);
}

// Elements are constructed, destructed in pages, so we expect
// the number of constructed / destructed elements to be a multiple of the
// page size and the constructor is invoked when the page is actually accessed
Expand Down