1"""
2Tests calling a function by basename
3"""
4
5import lldb
6from lldbsuite.test.decorators import *
7from lldbsuite.test.lldbtest import *
8from lldbsuite.test import lldbutil
9
10
11class CallCPPFunctionTestCase(TestBase):
12
13    def setUp(self):
14        TestBase.setUp(self)
15        self.line = line_number('main.cpp', '// breakpoint')
16
17    def test_with_run_command(self):
18        """Test calling a function by basename"""
19        self.build()
20        lldbutil.run_to_source_breakpoint(self, "// breakpoint", lldb.SBFileSpec("main.cpp"))
21
22        # The stop reason of the thread should be breakpoint.
23        self.expect("thread list",
24                    STOPPED_DUE_TO_BREAKPOINT,
25                    substrs=['stopped', 'stop reason = breakpoint'])
26
27        self.expect_expr("a_function_to_call()", result_type="int", result_value="0")
28