Files
clang-p2996/lldb/test/API/lang/cpp/decl-from-submodule/TestDeclFromSubmodule.py
Michael Buch 30f5240905 [lldb][Modules] Make decls from submodules visible for name lookup (#143098)
This patch ensures we can find decls in submodules during expression
evaluation. Previously, submodules would have all their decls marked as
`Hidden`. When Clang asked LLDB for decls, it would see them in the
submodule but `clang::Sema` would reject them because they weren't
`Visible` (specifically, `getAcceptableDecl` would fail during
`CppNameLookup`). Here we just mark the submodule as visible to work
around this problem.
2025-06-06 17:17:00 +01:00

22 lines
737 B
Python

"""Test that decl lookup into submodules in C++ works as expected."""
import lldb
import shutil
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class DeclFromSubmoduleTestCase(TestBase):
# Requires DWARF debug info which is not retained when linking with link.exe.
@skipIfWindows
# Lookup for decls in submodules fails in Linux
@expectedFailureAll(oslist=["linux"])
def test_expr(self):
self.build()
lldbutil.run_to_source_breakpoint(self, "return 0", lldb.SBFileSpec("main.cpp"))
self.expect_expr("func(1, 2)", result_type="int", result_value="3")
self.expect_expr("func(1)", result_type="int", result_value="1")