@Test
	public void testAddSameLabelDiffDataTypeKeepLatest() throws Exception {

		final String libname = "MyLibrary";
		final String label = "blue";
		final String address = "0x100";
		final String[] BLUE_PATH = new String[] { libname, label };
		final CategoryPath catPath = new CategoryPath("/cat1");
		final Structure myStruct = new StructureDataType(catPath, "MyStruct", 0);
		myStruct.add(new WordDataType());
		myStruct.add(new FloatDataType());
		final TypedefDataType myTypedef = new TypedefDataType("MyTypeDef", myStruct);

		mtf.initialize("NotepadMergeListingTest", new MergeProgramModifier() {

			@Override
			public void initializeProgram(MergeProgram program) throws Exception {
				program.addMemory("memory", "0x0", 0x200);
			}

			@Override
			public void modifyLatest(MergeProgram mergeProgram) throws Exception {
				createExternalLabel(mergeProgram, BLUE_PATH, address, myStruct,
					SourceType.USER_DEFINED);

				Program program = mergeProgram.getProgram();
				ExternalManager externalManager = program.getExternalManager();
				assertTrue(externalManager.contains(libname));
				ExternalLocation externalLocation = getExternalLocation(program, BLUE_PATH);
				assertNotNull(externalLocation);
				assertEquals(false, externalLocation.isFunction());

				assertEquals(libname + "::" + label, externalLocation.toString());
				assertEquals(addr(program, address), externalLocation.getAddress());
				assertTrue(externalLocation.getSource() == SourceType.USER_DEFINED);
				checkDataType(myStruct, externalLocation.getDataType());
			}

			@Override
			public void modifyPrivate(MergeProgram mergeProgram) throws Exception {
				createExternalLabel(mergeProgram, BLUE_PATH, address, myTypedef,
					SourceType.USER_DEFINED);

				Program program = mergeProgram.getProgram();
				ExternalManager externalManager = program.getExternalManager();
				assertTrue(externalManager.contains(libname));
				ExternalLocation externalLocation = getExternalLocation(program, BLUE_PATH);
				assertNotNull(externalLocation);
				assertEquals(false, externalLocation.isFunction());

				assertEquals(libname + "::" + label, externalLocation.toString());
				assertEquals(addr(program, address), externalLocation.getAddress());
				assertTrue(externalLocation.getSource() == SourceType.USER_DEFINED);
				checkDataType(myTypedef, externalLocation.getDataType());
			}
		});

		executeMerge(ASK_USER);
		chooseButtonAndApply("Resolve External Add Conflict", LATEST_BUTTON);
		waitForMergeCompletion();

		ExternalManager externalManager = resultProgram.getExternalManager();
		assertTrue(externalManager.contains(libname));
		Namespace externalLibrary =
			(Namespace) resultProgram.getSymbolTable().getLibrarySymbol(libname).getObject();

		SymbolTable symtab = resultProgram.getSymbolTable();

		List<Symbol> symbols = symtab.getSymbols(label, externalLibrary);
		assertEquals(1, symbols.size());
		Symbol blue = symbols.get(0);
		assertEquals(SymbolType.LABEL, blue.getSymbolType());
		assertTrue(blue.isExternal());
		ExternalLocation externalLocation = externalManager.getExternalLocation(blue);
		assertNotNull(externalLocation);
		assertEquals(libname, externalLocation.getLibraryName());
		assertEquals(addr(resultProgram, address), externalLocation.getAddress());
		assertTrue(externalLocation.getSource() == SourceType.USER_DEFINED);
		assertEquals(false, externalLocation.isFunction());
		checkDataType(myStruct, externalLocation.getDataType());
	}
The external function merger only detects and merges source differences when a name
difference is being merged.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/ExternalMergerAddTest.java