brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · b08c6ca Raw
74 lines · python
1"""2Tests that we correctly track AST layout info3(specifically alignment) when moving AST nodes4between several ClangASTImporter instances5(in this case, from a pch chain to executable6to expression AST).7"""8 9import lldb10import os11from lldbsuite.test.decorators import *12from lldbsuite.test.lldbtest import *13from lldbsuite.test import lldbutil14 15 16class TestPchChain(TestBase):17    @add_test_categories(["gmodules"])18    @expectedFailureAll("Chained pch debugging currently not fully supported")19    def test_expr(self):20        self.build()21        exe = self.getBuildArtifact("a.out")22        self.target = self.dbg.CreateTarget(exe)23        self.assertTrue(self.target, VALID_TARGET)24        lldbutil.run_break_set_by_file_and_line(25            self, "main.cpp", 9, num_expected_locations=126        )27 28        self.runCmd("run", RUN_SUCCEEDED)29 30        self.expect(31            "frame variable data",32            substrs=["row = 1", "col = 2", "row = 3", "col = 4", "stride = 5"],33        )34 35    @add_test_categories(["gmodules"])36    @expectedFailureAll("Chained pch debugging currently not fully supported")37    def test_frame_var(self):38        self.build()39        exe = self.getBuildArtifact("a.out")40        self.target = self.dbg.CreateTarget(exe)41        self.assertTrue(self.target, VALID_TARGET)42        lldbutil.run_break_set_by_file_and_line(43            self, "main.cpp", 9, num_expected_locations=144        )45 46        self.runCmd("run", RUN_SUCCEEDED)47 48        self.expect_expr(49            "data",50            result_type="MatrixData",51            result_children=[52                ValueCheck(53                    name="section",54                    children=[55                        ValueCheck(56                            name="origin",57                            children=[58                                ValueCheck(name="row", value="1"),59                                ValueCheck(name="col", value="2"),60                            ],61                        ),62                        ValueCheck(63                            name="size",64                            children=[65                                ValueCheck(name="row", value="3"),66                                ValueCheck(name="col", value="4"),67                            ],68                        ),69                    ],70                ),71                ValueCheck(name="stride", value="5"),72            ],73        )74