Skip to content

Commit a742693

Browse files
committed
[ctx_prof] Add missing test for PGOContextualProfile::getContainedGuids
1 parent 2bb6566 commit a742693

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ TEST_F(PGOCtxProfRWTest, RoundTrip) {
115115
EXPECT_EQ(Ctxes.size(), 2U);
116116
for (auto &[G, R] : roots())
117117
checkSame(*R, Ctxes.find(G)->second);
118+
119+
DenseSet<GlobalValue::GUID> Guids;
120+
Ctxes.at(1U).getContainedGuids(Guids);
121+
EXPECT_THAT(Guids,
122+
testing::WhenSorted(testing::ElementsAre(1U, 2U, 4U, 5U)));
123+
124+
Guids.clear();
125+
Ctxes.at(3U).getContainedGuids(Guids);
126+
EXPECT_THAT(Guids, testing::ElementsAre(3U));
118127
}
119128
}
120129

0 commit comments

Comments
 (0)