xref: /llvm-project/lldb/test/API/commands/expression/inline-namespace/TestInlineNamespace.py (revision 4cc8f2a017c76af25234afc7c380550e9c93135c)
1"""
2Test that we correctly handle inline namespaces.
3"""
4
5import lldb
6
7from lldbsuite.test.decorators import *
8from lldbsuite.test.lldbtest import *
9from lldbsuite.test import lldbutil
10
11
12class TestInlineNamespace(TestBase):
13
14    def test(self):
15        self.build()
16
17        lldbutil.run_to_source_breakpoint(self,
18            "// Set break point at this line.", lldb.SBFileSpec("main.cpp"))
19
20        # The 'A::B::f' function must be found via 'A::f' as 'B' is an inline
21        # namespace.
22        self.expect_expr("A::f()", result_type="int", result_value="3")
23        # But we should still find the function when we pretend the inline
24        # namespace is not inline.
25        self.expect_expr("A::B::f()", result_type="int", result_value="3")
26