X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=unittests%2FProfileData%2FInstrProfTest.cpp;fp=unittests%2FProfileData%2FInstrProfTest.cpp;h=1ccc3ca5d69591c8f5e4d5b1a4c433196e975830;hp=453ad0f22b3441b270df1fe051ad7c1ce217eed7;hb=2401ff6f94b780ecdc36bed9aaf7b4e6f3f983fe;hpb=fac1bfe37da03ffee2674250475b3a9e0ba39e64 diff --git a/unittests/ProfileData/InstrProfTest.cpp b/unittests/ProfileData/InstrProfTest.cpp index 453ad0f22b3..1ccc3ca5d69 100644 --- a/unittests/ProfileData/InstrProfTest.cpp +++ b/unittests/ProfileData/InstrProfTest.cpp @@ -624,11 +624,24 @@ TEST_F(InstrProfTest, instr_prof_symtab_compression_test) { } FuncNameStrings += FuncNameStrings2; - // Now decompress + // Now decompress: InstrProfSymtab Symtab; Symtab.create(StringRef(FuncNameStrings)); - // Now check + // Now do the checks: + // First sampling some data points: + StringRef R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames1[0])); + ASSERT_EQ(StringRef("func_0"), R); + R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames1[1])); + ASSERT_EQ(StringRef("fooooooooooooooo_0"), R); + R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames1[998])); + ASSERT_EQ(StringRef("func_499"), R); + R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames1[999])); + ASSERT_EQ(StringRef("fooooooooooooooo_499"), R); + R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames2[100])); + ASSERT_EQ(StringRef("BAR_50"), R); + R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames2[101])); + ASSERT_EQ(StringRef("BlahblahBlahblahBar_50"), R); for (int I = 0; I < 10 * 1024; I++) { std::string N[4]; N[0] = FuncNames1[2 * I];