Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / lang / cpp / const_this / TestConstThis.py
blob4b7d3aadb62ab65e8fa35c7d8af4d028667f944f
1 import lldb
2 from lldbsuite.test.decorators import *
3 from lldbsuite.test.lldbtest import *
4 from lldbsuite.test import lldbutil
7 class TestCase(TestBase):
8 NO_DEBUG_INFO_TESTCASE = True
10 def run_class_tests(self):
11 # Expression not referencing context class.
12 self.expect_expr("1 + 1", result_type="int", result_value="2")
13 # Referencing context class.
14 # FIXME: This and the expression below should return const types.
15 self.expect_expr("member", result_type="int", result_value="3")
16 # Check the type of context class.
17 self.expect_expr("this", result_type="ContextClass *")
19 def test_member_func(self):
20 self.build()
21 lldbutil.run_to_source_breakpoint(
22 self, "// break in function in class.", lldb.SBFileSpec("main.cpp")
24 self.run_class_tests()
26 def test_templated_member_func(self):
27 self.build()
28 lldbutil.run_to_source_breakpoint(
29 self,
30 "// break in templated function in class.",
31 lldb.SBFileSpec("main.cpp"),
33 self.run_class_tests()
35 def run_template_class_tests(self):
36 # Expression not referencing context class.
37 self.expect_expr("1 + 1", result_type="int", result_value="2")
38 # Referencing context class.
39 # FIXME: This and the expression below should return const types.
40 self.expect_expr("member", result_type="int", result_value="4")
41 # Check the type of context class.
42 self.expect_expr("this", result_type="TemplatedContextClass<int> *")
44 def test_template_member_func(self):
45 self.build()
46 lldbutil.run_to_source_breakpoint(
47 self,
48 "// break in function in templated class.",
49 lldb.SBFileSpec("main.cpp"),
51 self.run_template_class_tests()
53 def test_template_templated_member_func(self):
54 self.build()
55 lldbutil.run_to_source_breakpoint(
56 self,
57 "// break in templated function in templated class.",
58 lldb.SBFileSpec("main.cpp"),
60 self.run_template_class_tests()