@Test
	@SuppressWarnings("unused")
	public void testStructWithLoop() throws CancelledException, IOException, DWARFException {

		// base types
		DebugInfoEntry intDIE = addInt();
		DebugInfoEntry floatDIE = addFloat();
		//-----------------------
		// decl mystruct
		DebugInfoEntry struct1DeclDIE = newDeclStruct("mystruct").create();
		DebugInfoEntry struct1PtrDIE = addPtr(struct1DeclDIE);
		//-----------------------
		// mystruct2 { ptr_to_struct1 : struct1PtrDIE }
		DebugInfoEntry struct2DIE = newStruct("mystruct2", 10).create();
		DebugInfoEntry struct2F1DIE =
			newMember(struct2DIE, "ptr_to_struct1", struct1PtrDIE, 0).create();
		DebugInfoEntry struct2PtrDIE = addPtr(struct2DIE);
		//--------------------
		// spec mystruct { f1: intDIE; f2_ptr_to_struct2: struct2PtrDIE }
		DebugInfoEntry struct1DIE =
			newSpecStruct(struct1DeclDIE, 100).addString(DW_AT_name, "mystruct").create();
		DebugInfoEntry structF1DIE = newMember(struct1DIE, "f1", intDIE, 0).create();
		DebugInfoEntry structF2DIE =
			newMember(struct1DIE, "f2_ptr_to_struct2", struct2PtrDIE, 10).create();
		//----------------------

		importAllDataTypes();

		Structure structdt = (Structure) dataMgr.getDataType(uncatCP, "mystruct");
		Structure struct2dt = (Structure) dataMgr.getDataType(uncatCP, "mystruct2");

		assertEquals(100, structdt.getLength());
		assertEquals(10, struct2dt.getLength());

		assertEquals("f2_ptr_to_struct2", structdt.getDefinedComponents()[1].getFieldName());
		assertTrue(structdt.getDefinedComponents()[1].getDataType() instanceof Pointer);
	}
Test structure definition when incompatible structure defs are present in two CUs.
@throws CancelledException
@throws IOException
@throws DWARFException
Ghidra/Features/Base/src/test.slow/java/ghidra/app/util/bin/format/dwarf/DWARFDataTypeImporterTest.java