llvm.org GIT mirror llvm / 2401ff6
Add explicit string checks in test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256796 91177308-0d34-0410-b5e6-96231b3b80d8 Xinliang David Li 3 years ago
1 changed file(s) with 15 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
623623 }
624624 FuncNameStrings += FuncNameStrings2;
625625
626 // Now decompress
626 // Now decompress:
627627 InstrProfSymtab Symtab;
628628 Symtab.create(StringRef(FuncNameStrings));
629629
630 // Now check
630 // Now do the checks:
631 // First sampling some data points:
632 StringRef R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames1[0]));
633 ASSERT_EQ(StringRef("func_0"), R);
634 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames1[1]));
635 ASSERT_EQ(StringRef("fooooooooooooooo_0"), R);
636 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames1[998]));
637 ASSERT_EQ(StringRef("func_499"), R);
638 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames1[999]));
639 ASSERT_EQ(StringRef("fooooooooooooooo_499"), R);
640 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames2[100]));
641 ASSERT_EQ(StringRef("BAR_50"), R);
642 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames2[101]));
643 ASSERT_EQ(StringRef("BlahblahBlahblahBar_50"), R);
631644 for (int I = 0; I < 10 * 1024; I++) {
632645 std::string N[4];
633646 N[0] = FuncNames1[2 * I];