858f2785be8403ca5a87b55c1cc239e3b4f01080
[openbsd] /
1 """
2 This is a test to ensure that both lldb is reconstructing the right
3 calling convention for a CXXRecordDecl as represented by:
4
5    DW_CC_pass_by_reference
6    DW_CC_pass_by_value
7
8 and to also make sure that the ASTImporter is copying over this
9 setting when importing the CXXRecordDecl via setArgPassingRestrictions.
10 """
11
12 import lldb
13 from lldbsuite.test.decorators import *
14 from lldbsuite.test.lldbtest import *
15 from lldbsuite.test import lldbutil
16
17
18 class TestArgumentPassingRestrictions(TestBase):
19
20   mydir = TestBase.compute_mydir(__file__)
21
22   @skipIf(compiler="clang", compiler_version=['<', '7.0'])
23   def test_argument_passing_restrictions(self):
24     self.build()
25
26     lldbutil.run_to_source_breakpoint(self, '// break here',
27             lldb.SBFileSpec("main.cpp"))
28
29     self.expect("expr returnPassByRef()",
30             substrs=['(PassByRef)', '= 11223344'])
31
32     self.expect("expr takePassByRef(p)",
33             substrs=['(int)', '= 42'])