llvm.org GIT mirror llvm / a6d12c9
Improve InstrProfSymtab test coverage git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256099 91177308-0d34-0410-b5e6-96231b3b80d8 Xinliang David Li 3 years ago
1 changed file(s) with 27 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
545545 ASSERT_EQ(StringRef("bar2"), R);
546546 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("bar3"));
547547 ASSERT_EQ(StringRef("bar3"), R);
548
549 // Now incrementally update the symtab
550 Symtab.addFuncName("blah_1");
551 Symtab.addFuncName("blah_2");
552 Symtab.addFuncName("blah_3");
553 // Finalize it
554 Symtab.finalizeSymtab();
555
556 // Check again
557 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("blah_1"));
558 ASSERT_EQ(StringRef("blah_1"), R);
559 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("blah_2"));
560 ASSERT_EQ(StringRef("blah_2"), R);
561 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("blah_3"));
562 ASSERT_EQ(StringRef("blah_3"), R);
563 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("func1"));
564 ASSERT_EQ(StringRef("func1"), R);
565 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("func2"));
566 ASSERT_EQ(StringRef("func2"), R);
567 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("func3"));
568 ASSERT_EQ(StringRef("func3"), R);
569 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("bar1"));
570 ASSERT_EQ(StringRef("bar1"), R);
571 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("bar2"));
572 ASSERT_EQ(StringRef("bar2"), R);
573 R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("bar3"));
574 ASSERT_EQ(StringRef("bar3"), R);
548575 }
549576
550577 } // end anonymous namespace