[mlir][PDLL] Allow (and ignore) `-D` tablegen macros. (#124166)
[llvm-project.git] / lldb / test / API / lang / cpp / crtp / TestCppCRTP.py
blob5a987a074c2eda1cdff2a8644931bb94b7f10f51
1 """
2 A test for the curiously recurring template pattern (or CRTP).
4 Note that the derived class is referenced directly from the parent class in the
5 test. If this fails then there is a good chance that LLDB tried to eagerly
6 resolve the definition of the derived class while constructing the base class.
7 """
9 import lldb
10 from lldbsuite.test.decorators import *
11 from lldbsuite.test.lldbtest import *
12 from lldbsuite.test import lldbutil
15 class TestCase(TestBase):
16 @no_debug_info_test
17 def test(self):
18 self.build()
19 self.createTestTarget()
21 # Try using the class in the expression evaluator.
22 self.expect_expr(
23 "derived",
24 result_type="Derived",
25 result_children=[
26 ValueCheck(name="Base<Derived>"),
27 ValueCheck(name="member", value="0"),
31 # Try accessing the members of the class and base class.
32 self.expect_expr("derived.pointer", result_type="Derived *")
33 self.expect_expr("derived.member", result_type="int", result_value="0")