Files
llvm-project/lldb/packages/Python/lldbsuite/test/lang/cpp/call-function/TestCallCPPFunction.py
T

39 lines
1.2 KiB
Python
Raw Normal View History

2013-04-30 22:05:15 +00:00
"""
Tests calling a function by basename
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
2013-04-30 22:05:15 +00:00
2013-04-30 22:05:15 +00:00
class CallCPPFunctionTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
2013-04-30 22:05:15 +00:00
def setUp(self):
TestBase.setUp(self)
self.line = line_number('main.cpp', '// breakpoint')
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
2015-09-30 10:12:40 +00:00
def test_with_run_command(self):
2013-04-30 22:05:15 +00:00
"""Test calling a function by basename"""
2015-09-30 10:12:40 +00:00
self.build()
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
2013-04-30 22:05:15 +00:00
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
2013-04-30 22:05:15 +00:00
self.runCmd("process launch", RUN_SUCCEEDED)
2013-04-30 22:05:15 +00:00
# The stop reason of the thread should be breakpoint.
self.expect("thread list",
STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped', 'stop reason = breakpoint'])
2013-04-30 22:05:15 +00:00
self.expect("expression -- a_function_to_call()",
startstr="(int) $0 = 0")