Skip to content

Commit 44dea6a

Browse files
committed
Extend unit test to show that we cache the symbol table
Once it has been created then passing `can_create=false` should have no effect.
1 parent b63d34a commit 44dea6a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lldb/unittests/Symbol/SymtabTest.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,4 +756,8 @@ TEST_F(SymtabTest, TestSymtabCreatedOnDemand) {
756756
// But it should be created on demand.
757757
module_symtab = module_sp->GetSymtab(/*can_create=*/true);
758758
ASSERT_NE(module_symtab, nullptr);
759+
760+
// And we should be able to get it again once it has been created.
761+
Symtab *cached_module_symtab = module_sp->GetSymtab(/*can_create=*/false);
762+
ASSERT_EQ(module_symtab, cached_module_symtab);
759763
}

0 commit comments

Comments
 (0)