xref: /llvm-project/lldb/test/API/lang/cpp/overloaded-functions/TestOverloadedFunctions.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
1"""
2Tests that functions with the same name are resolved correctly.
3"""
4
5import lldb
6from lldbsuite.test.decorators import *
7from lldbsuite.test.lldbtest import *
8from lldbsuite.test import lldbutil
9
10
11class OverloadedFunctionsTestCase(TestBase):
12    def test_with_run_command(self):
13        """Test that functions with the same name are resolved correctly"""
14        self.build()
15        lldbutil.run_to_source_breakpoint(
16            self, "// breakpoint", lldb.SBFileSpec("main.cpp")
17        )
18
19        self.expect("expression -- Dump(myB)", startstr="(int) $0 = 2")
20
21        self.expect("expression -- Static()", startstr="(int) $1 = 1")
22