]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / lang / cpp / overloaded-functions / TestOverloadedFunctions.py
1 """
2 Tests that functions with the same name are resolved correctly.
3 """
4
5 import lldb
6 from lldbsuite.test.decorators import *
7 from lldbsuite.test.lldbtest import *
8 from lldbsuite.test import lldbutil
9
10
11 class CPPStaticMethodsTestCase(TestBase):
12
13     mydir = TestBase.compute_mydir(__file__)
14
15     def setUp(self):
16         TestBase.setUp(self)
17         self.line = line_number('main.cpp', '// breakpoint')
18
19     @expectedFailureAll(
20         oslist=["windows"],
21         bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
22     def test_with_run_command(self):
23         """Test that functions with the same name are resolved correctly"""
24         self.build()
25         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
26
27         lldbutil.run_break_set_by_file_and_line(
28             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
29
30         self.runCmd("process launch", RUN_SUCCEEDED)
31
32         # The stop reason of the thread should be breakpoint.
33         self.expect("thread list",
34                     STOPPED_DUE_TO_BREAKPOINT,
35                     substrs=['stopped', 'stop reason = breakpoint'])
36
37         self.expect("expression -- Dump(myB)",
38                     startstr="(int) $0 = 2")
39
40         self.expect("expression -- Static()",
41                     startstr="(int) $1 = 1")