xref: /llvm-project/lldb/test/API/commands/expression/namespace-alias/TestInlineNamespaceAlias.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
1"""
2Test that we correctly handle namespace
3expression evaluation through namespace
4aliases.
5"""
6
7import lldb
8
9from lldbsuite.test.decorators import *
10from lldbsuite.test.lldbtest import *
11from lldbsuite.test import lldbutil
12
13
14class TestInlineNamespace(TestBase):
15    @skipIf(compiler="clang", compiler_version=["<", "16.0"])
16    def test(self):
17        self.build()
18
19        lldbutil.run_to_source_breakpoint(
20            self, "return A::B::C::a", lldb.SBFileSpec("main.cpp")
21        )
22
23        self.expect_expr("A::C::a", result_type="int", result_value="-1")
24        self.expect_expr("A::D::a", result_type="int", result_value="-1")
25
26        self.expect_expr("A::C::func()", result_type="int", result_value="0")
27        self.expect_expr("A::D::func()", result_type="int", result_value="0")
28
29        self.expect_expr("E::C::a", result_type="int", result_value="-1")
30        self.expect_expr("E::D::a", result_type="int", result_value="-1")
31        self.expect_expr("F::a", result_type="int", result_value="-1")
32        self.expect_expr("G::a", result_type="int", result_value="-1")
33