@Test
	public void testIndirectCallOverride() throws AddressFormatException {
		//verify the instructions needed for the test
		Address indirectCallAddr = defaultSpace.getAddress(INDIRECT_CALL_100000);
		Instruction indirectCall = program.getListing().getInstructionAt(indirectCallAddr);
		assertNotNull(indirectCall);
		assertEquals("call r0", indirectCall.toString());

		PcodeOp[] unmodified = indirectCall.getPcode(false);
		assertTrue(unmodified[0].getOpcode() == PcodeOp.COPY); //save return address to lr
		assertTrue(unmodified[1].getOpcode() == PcodeOp.CALLIND); //indirect call

		//no overrides applied, pcode should be the same whether or not overrides are requested
		assertTrue(equalPcodeOpArrays(unmodified, indirectCall.getPcode(true)));
		assertTrue(equalPcodeOpArrays(unmodified, indirectCall.getPcode()));

		//add a non-primary CALL_OVERRIDE_UNCONDITIONAL reference 
		int id = program.startTransaction("test");
		Reference overrideRef = refManager.addMemoryReference(indirectCallAddr, func1Addr,
			RefType.CALL_OVERRIDE_UNCONDITIONAL, SourceType.USER_DEFINED, -1);
		refManager.setPrimary(overrideRef, false);
		program.endTransaction(id, true);

		//no modifications to pcode since the reference is not primary
		assertTrue(equalPcodeOpArrays(unmodified, indirectCall.getPcode(true)));

		//make reference primary
		id = program.startTransaction("test");
		refManager.setPrimary(overrideRef, true);
		program.endTransaction(id, true);

		//verify that nothing changes if no overrides are requested
		assertTrue(equalPcodeOpArrays(unmodified, indirectCall.getPcode(false)));
		assertTrue(equalPcodeOpArrays(unmodified, indirectCall.getPcode()));

		//verify that the CALLIND op has been changed to a CALL op
		//with call target func1Addr
		PcodeOp[] overridden = indirectCall.getPcode(true);
		assertFalse(equalPcodeOpArrays(unmodified, overridden));
		assertEquals(unmodified.length, overridden.length);
		assertEquals(unmodified.length, 2);
		assertTrue(equalPcodeOps(unmodified[0], overridden[0]));
		PcodeOp callind = unmodified[1];
		PcodeOp call = overridden[1];
		assertNull(callind.getOutput());
		assertNull(call.getOutput());
		assertTrue(callind.getOpcode() == PcodeOp.CALLIND);
		assertTrue(call.getOpcode() == PcodeOp.CALL);
		assertTrue(callind.getNumInputs() == 1);
		assertTrue(call.getNumInputs() == 1);
		assertTrue(callind.getInput(0).getAddress().isRegisterAddress());
		assertTrue(call.getInput(0).getAddress().isMemoryAddress());
		assertTrue(call.getInput(0).getOffset() == func1Addr.getOffset());

		//add another primary CALL_OVERRIDE_UNCONDITIONAL reference
		//pcode should be unmodified: override only active if exactly one primary reference
		id = program.startTransaction("test");
		overrideRef = refManager.addMemoryReference(indirectCallAddr, func2Addr,
			RefType.CALL_OVERRIDE_UNCONDITIONAL, SourceType.USER_DEFINED, 0);
		refManager.setPrimary(overrideRef, true);
		program.endTransaction(id, true);
		assertTrue(equalPcodeOpArrays(unmodified, indirectCall.getPcode(true)));

		//verify that nothing changes if no overrides are requested
		assertTrue(equalPcodeOpArrays(unmodified, indirectCall.getPcode(false)));
		assertTrue(equalPcodeOpArrays(unmodified, indirectCall.getPcode()));
	}
Tests that a CALL_OVERRIDE_UNCONDITIONAL reference:
  1) converts a CALLIND op to a CALL op
  2) changes the call target
@throws AddressFormatException if {@code AddressSpace.getAddress} throws it
Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/program/model/pcode/PcodeEmitContextTest.java