brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 0f21806 Raw
34 lines · python
1import lldb2from lldbsuite.test.decorators import *3from lldbsuite.test.lldbtest import *4from lldbsuite.test import lldbutil5 6 7class CPPAcceleratorTableTestCase(TestBase):8    @skipUnlessDarwin9    @skipIf(debug_info=no_match(["dwarf"]))10    @skipIf(dwarf_version=[">=", "5"])11    def test(self):12        """Test that type lookups fail early (performance)"""13        self.build()14 15        logfile = self.getBuildArtifact("dwarf.log")16 17        self.expect("log enable dwarf lookups -f" + logfile)18        target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(19            self, "break here", lldb.SBFileSpec("main.cpp")20        )21        # Pick one from the middle of the list to have a high chance22        # of it not being in the first file looked at.23        self.expect("frame variable inner_d")24 25        with open(logfile) as f:26            log = f.readlines()27        n = 028        for line in log:29            if re.findall(r"[abcdefg]\.o: FindByNameAndTag\(\)", line):30                self.assertIn("d.o", line)31                n += 132 33        self.assertEqual(n, 1, "".join(log))34