]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/expression_command/pr35310/TestExprsBug35310.py
Vendor import of lldb trunk r338536:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / expression_command / pr35310 / TestExprsBug35310.py
1 from __future__ import print_function
2
3 import lldb
4 from lldbsuite.test.decorators import *
5 from lldbsuite.test.lldbtest import *
6 from lldbsuite.test import lldbutil
7
8 class ExprBug35310(TestBase):
9
10     mydir = TestBase.compute_mydir(__file__)
11
12     def setUp(self):
13         # Call super's setUp().
14         TestBase.setUp(self)
15
16         self.main_source = "main.cpp"
17         self.main_source_spec = lldb.SBFileSpec(self.main_source)
18
19     @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
20     def test_issue35310(self):
21         """Test invoking functions with non-standard linkage names.
22
23         The GNU abi_tag extension used by libstdc++ is a common source
24         of these, but they could originate from other reasons as well.
25         """
26         self.build()
27
28         (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
29                                           '// Break here', self.main_source_spec)
30         frame = thread.GetFrameAtIndex(0)
31
32         value = frame.EvaluateExpression("a.test_abi_tag()")
33         self.assertTrue(value.IsValid())
34         self.assertTrue(value.GetError().Success())
35         self.assertEqual(value.GetValueAsSigned(0), 1)
36
37         value = frame.EvaluateExpression("a.test_asm_name()")
38         self.assertTrue(value.IsValid())
39         self.assertTrue(value.GetError().Success())
40         self.assertEqual(value.GetValueAsSigned(0), 2)