2 from lldbsuite
.test
.decorators
import *
3 from lldbsuite
.test
.lldbtest
import *
4 from lldbsuite
.test
import lldbutil
7 class TestFunctionQualifiers(TestBase
):
10 lldbutil
.run_to_source_breakpoint(
11 self
, "// break here", lldb
.SBFileSpec("main.cpp")
14 # Test calling a function that has const/non-const overload.
15 self
.expect_expr("c.func()", result_type
="int", result_value
="111")
16 self
.expect_expr("const_c.func()", result_type
="int", result_value
="222")
18 # Call a function that is only const on a const/non-const instance.
19 self
.expect_expr("c.const_func()", result_type
="int", result_value
="333")
20 self
.expect_expr("const_c.const_func()", result_type
="int", result_value
="333")
22 # Call a function that is not const on a const/non-const instance.
23 self
.expect_expr("c.nonconst_func()", result_type
="int", result_value
="444")
25 "expr const_c.nonconst_func()",
28 "'this' argument to member function 'nonconst_func' has type 'const C', but function is not marked const"