@@ -721,7 +721,7 @@ TEST_F(SymtabTest, TestDecodeCStringMaps) {
721721 ASSERT_NE (symbol, nullptr );
722722}
723723
724- TEST_F (SymtabTest, TestSymtabCreatedOnDemand ) {
724+ TEST_F (SymtabTest, TestSymbolFileAndSymbolTableCreatedOnDemand ) {
725725 auto ExpectedFile = TestFile::fromYaml (R"(
726726--- !ELF
727727FileHeader:
@@ -749,10 +749,20 @@ TEST_F(SymtabTest, TestSymtabCreatedOnDemand) {
749749 ASSERT_THAT_EXPECTED (ExpectedFile, llvm::Succeeded ());
750750 auto module_sp = std::make_shared<Module>(ExpectedFile->moduleSpec ());
751751
752- // The symbol table should not be loaded by default.
752+ // The symbol file should not be created by default.
753753 Symtab *module_symtab = module_sp->GetSymtab (/* can_create=*/ false );
754754 ASSERT_EQ (module_symtab, nullptr );
755755
756+ // Even if the symbol file is created, the symbol table should not be created by default.
757+
758+ // TODO:
759+ // I need to create a symbol file here, but without causing it to parse the symbol table.
760+ // See next line as a failed attempt.
761+
762+ // module_sp->GetSymbolFile(/*can_create=*/true); // Cannot do this because it will parse the symbol table.
763+ module_symtab = module_sp->GetSymtab (/* can_create=*/ false );
764+ ASSERT_EQ (module_symtab, nullptr );
765+
756766 // But it should be created on demand.
757767 module_symtab = module_sp->GetSymtab (/* can_create=*/ true );
758768 ASSERT_NE (module_symtab, nullptr );
0 commit comments