7 from lldbsuite.test.decorators import *
8 from lldbsuite.test.lldbtest import *
9 from lldbsuite.test import lldbutil
12 class TestClangModuleHashMismatch(TestBase):
13 mydir = TestBase.compute_mydir(__file__)
16 @skipIf(debug_info=no_match(["gmodules"]))
18 with open(self.getBuildArtifact("module.modulemap"), "w") as f:
20 module Foo { header "f.h" }
22 with open(self.getBuildArtifact("f.h"), "w") as f:
28 mod_cache = self.getBuildArtifact("private-module-cache")
29 if os.path.isdir(mod_cache):
30 shutil.rmtree(mod_cache)
32 self.assertTrue(os.path.isdir(mod_cache), "module cache exists")
34 logfile = self.getBuildArtifact("host.log")
35 self.runCmd("log enable -v -f %s lldb host" % logfile)
36 target, _, _, _ = lldbutil.run_to_source_breakpoint(
37 self, "break here", lldb.SBFileSpec("main.m"))
38 target.GetModuleAtIndex(0).FindTypes('my_int')
41 with open(logfile, 'r') as f:
43 if "hash mismatch" in line and "Foo" in line:
45 self.assertTrue(found)