2 Test that recursive types are handled correctly.
7 import lldbsuite
.test
.lldbutil
as lldbutil
8 from lldbsuite
.test
.lldbtest
import *
11 class RecursiveTypesTestCase(TestBase
):
13 # Call super's setUp().
16 # Find the line number to break for main.c.
17 self
.line
= line_number("recursive_type_main.cpp", "// Test at this line.")
19 self
.d1
= {"CXX_SOURCES": "recursive_type_main.cpp recursive_type_1.cpp"}
20 self
.d2
= {"CXX_SOURCES": "recursive_type_main.cpp recursive_type_2.cpp"}
22 def test_recursive_type_1(self
):
23 """Test that recursive structs are displayed correctly."""
24 self
.build(dictionary
=self
.d1
)
25 self
.setTearDownCleanup(dictionary
=self
.d1
)
28 def test_recursive_type_2(self
):
29 """Test that recursive structs are displayed correctly."""
30 self
.build(dictionary
=self
.d2
)
31 self
.setTearDownCleanup(dictionary
=self
.d2
)
34 def print_struct(self
):
35 self
.runCmd("file " + self
.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET
)
37 lldbutil
.run_break_set_by_file_and_line(
39 "recursive_type_main.cpp",
41 num_expected_locations
=-1,
45 self
.runCmd("run", RUN_SUCCEEDED
)
47 self
.runCmd("expression tpi")
48 self
.runCmd("expression *tpi")