================ @@ -0,0 +1,40 @@ +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestCaseTypedefToOuterFwd(TestBase): + """ + We a global variable whose type is forward declared. We then + try to get the Ref typedef (whose definition is in either main.o + or lib.o). Make sure we correctly resolve this typedef. + + We test this for two cases, where the definition lives + in main.o or lib.o. + """ + + def check_global_var(self, target, name: str): + var = target.FindFirstGlobalVariable(name) + self.assertSuccess(var.GetError(), f"Found {name}") + + var_type = var.GetType() + self.assertTrue(var_type) + + impl = var_type.GetPointeeType() + self.assertTrue(impl) + + ref = impl.FindDirectNestedType("Ref") + self.assertTrue(ref) + + self.assertEqual(ref.GetCanonicalType(), var_type) + + def test_definition_in_main(self): ---------------- labath wrote:
Maybe merge these into one so we don't end up building the binary twice (for each debug info flavour) https://github.com/llvm/llvm-project/pull/120569 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits