diff options
author | mingmingl <mingmingl@google.com> | 2025-05-15 09:56:52 -0700 |
---|---|---|
committer | mingmingl <mingmingl@google.com> | 2025-05-15 09:56:52 -0700 |
commit | d15ae3e73589b50edeb2ab823976734eaa3806e5 (patch) | |
tree | 53f7fa084c3d06a60461fea2125e26ec0b07e771 /llvm/unittests/ProfileData/DataAccessProfTest.cpp | |
parent | 6dd04e46542851b84bf26cd95245399204072085 (diff) | |
download | llvm-users/mingmingl-llvm/test.zip llvm-users/mingmingl-llvm/test.tar.gz llvm-users/mingmingl-llvm/test.tar.bz2 |
Support reading and writing data access profiles in memprof v4.users/mingmingl-llvm/test
Diffstat (limited to 'llvm/unittests/ProfileData/DataAccessProfTest.cpp')
-rw-r--r-- | llvm/unittests/ProfileData/DataAccessProfTest.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/unittests/ProfileData/DataAccessProfTest.cpp b/llvm/unittests/ProfileData/DataAccessProfTest.cpp index 127230d..084a8e9 100644 --- a/llvm/unittests/ProfileData/DataAccessProfTest.cpp +++ b/llvm/unittests/ProfileData/DataAccessProfTest.cpp @@ -78,7 +78,7 @@ TEST(MemProf, DataAccessProfile) { // Test that symbol names and file names are stored in the input order. EXPECT_THAT( llvm::to_vector(llvm::make_first_range(Data.getStrToIndexMapRef())), - ElementsAre("foo", "bar.__uniq.321", "file2", "file1")); + ElementsAre("foo", "sym2", "bar.__uniq.321", "file2", "sym1", "file1")); EXPECT_THAT(Data.getKnownColdSymbols(), ElementsAre("sym2", "sym1")); EXPECT_THAT(Data.getKnownColdHashes(), ElementsAre(789, 678)); @@ -134,9 +134,10 @@ TEST(MemProf, DataAccessProfile) { testing::IsEmpty()); EXPECT_FALSE(deserializedData.deserialize(p)); - EXPECT_THAT(llvm::to_vector(llvm::make_first_range( - deserializedData.getStrToIndexMapRef())), - ElementsAre("foo", "bar.__uniq.321", "file2", "file1")); + EXPECT_THAT( + llvm::to_vector( + llvm::make_first_range(deserializedData.getStrToIndexMapRef())), + ElementsAre("foo", "sym2", "bar.__uniq.321", "file2", "sym1", "file1")); EXPECT_THAT(deserializedData.getKnownColdSymbols(), ElementsAre("sym2", "sym1")); EXPECT_THAT(deserializedData.getKnownColdHashes(), ElementsAre(789, 678)); @@ -158,7 +159,7 @@ TEST(MemProf, DataAccessProfile) { Field(&DataAccessProfRecordRef::AccessCount, 100), Field(&DataAccessProfRecordRef::IsStringLiteral, false), Field(&DataAccessProfRecordRef::Locations, testing::IsEmpty())), - AllOf(Field(&DataAccessProfRecordRef::SymbolID, 1), + AllOf(Field(&DataAccessProfRecordRef::SymbolID, 2), Field(&DataAccessProfRecordRef::AccessCount, 123), Field(&DataAccessProfRecordRef::IsStringLiteral, false), Field(&DataAccessProfRecordRef::Locations, |