diff options
Diffstat (limited to 'llvm/unittests/ProfileData/InstrProfTest.cpp')
-rw-r--r-- | llvm/unittests/ProfileData/InstrProfTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/unittests/ProfileData/InstrProfTest.cpp b/llvm/unittests/ProfileData/InstrProfTest.cpp index 3615b0a4359..e2349f4fc57 100644 --- a/llvm/unittests/ProfileData/InstrProfTest.cpp +++ b/llvm/unittests/ProfileData/InstrProfTest.cpp @@ -746,6 +746,12 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_test) { R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("bar3")); ASSERT_EQ(StringRef("bar3"), R); + // negative tests + R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("bar4")); + ASSERT_EQ(StringRef(), R); + R = Symtab.getFuncName(IndexedInstrProf::ComputeHash("foo4")); + ASSERT_EQ(StringRef(), R); + // Now incrementally update the symtab Symtab.addFuncName("blah_1"); Symtab.addFuncName("blah_2"); |