Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / lang / cpp / function-qualifiers / TestCppFunctionQualifiers.py
blob93e509478c27aaccc7aca27fe7352dedf5b50ab0
1 import lldb
2 from lldbsuite.test.decorators import *
3 from lldbsuite.test.lldbtest import *
4 from lldbsuite.test import lldbutil
7 class TestFunctionQualifiers(TestBase):
8 def test(self):
9 self.build()
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")
24 self.expect(
25 "expr const_c.nonconst_func()",
26 error=True,
27 substrs=[
28 "'this' argument to member function 'nonconst_func' has type 'const C', but function is not marked const"