@Test
	public void testFlowOverridesAndDelaySlots() throws AddressFormatException {
		//verify that the test program contains the instructions for the test
		Address calldsAddr = defaultSpace.getAddress(CALLDS_FUNC3_10002a);
		Instruction callds = program.getListing().getInstructionAt(calldsAddr);
		assertNotNull(callds);
		assertEquals("callds 0x" + func3Addr.toString(), callds.toString());

		Address callAddr = defaultSpace.getAddress(CALL_FUNC1_10002c);
		Instruction call = program.getListing().getInstructionAt(callAddr);
		assertNotNull(call);
		assertEquals("_call 0x" + func1Addr.toString(), call.toString());

		//grab pcode for both instructions before any overrides applied
		PcodeOp[] calldsUnmodified = callds.getPcode(false);
		assertTrue(calldsUnmodified.length == 4);
		assertTrue(calldsUnmodified[0].getOpcode() == PcodeOp.COPY);  //from inst in delay slot
		assertTrue(calldsUnmodified[1].getOpcode() == PcodeOp.CALL);  //from inst in delay slot
		assertTrue(calldsUnmodified[1].getInput(0).getOffset() == func1Addr.getOffset());
		assertTrue(calldsUnmodified[2].getOpcode() == PcodeOp.COPY);  //save ret address to lr
		assertTrue(calldsUnmodified[3].getInput(0).getOffset() == func3Addr.getOffset());
		assertTrue(calldsUnmodified[3].getOpcode() == PcodeOp.CALL);  //call to func3
		PcodeOp[] callUnmodified = call.getPcode(false);
		assertTrue(callUnmodified.length == 2);
		assertTrue(equalPcodeOps(callUnmodified[0], calldsUnmodified[0]));  //save ret address to lr
		assertTrue(equalPcodeOps(callUnmodified[1], calldsUnmodified[1]));  //call to func1

		//verify that pcode is the same whether or not you request overrides for the instruction
		//in the delay slot
		assertTrue(equalPcodeOpArrays(call.getPcode(false), call.getPcode(true)));

		//this is a corner case that would probably never occur in practice
		//callds has a CALL op, so a call reference, R, is created by default
		//the instruction in the delay slot also has a CALL op, so when its pcode gets
		//inserted into the pcode for callds the pcode emitter sees R and thinks that
		//the CALL op in the delay slot should be overridden
		//end result is that whether or not you request overrides matters because of a
		//reference laid down automatically 
		PcodeOp[] cornerCase = callds.getPcode(true);
		assertFalse(equalPcodeOpArrays(callds.getPcode(false), cornerCase));
		assertTrue(cornerCase[0].getOpcode() == PcodeOp.COPY);  //from inst in delay slot
		assertTrue(cornerCase[1].getOpcode() == PcodeOp.CALL);  //from inst in delay slot, overridden
		assertTrue(cornerCase[1].getInput(0).getOffset() == func3Addr.getOffset());
		assertTrue(cornerCase[2].getOpcode() == PcodeOp.COPY);  //save ret address to lr
		assertTrue(cornerCase[3].getOpcode() == PcodeOp.CALL);  //call to func3
		assertTrue(cornerCase[3].getInput(0).getOffset() == func3Addr.getOffset());

		//flow override on instruction in delay slot
		int tid = program.startTransaction("test");
		call.setFlowOverride(FlowOverride.BRANCH);
		program.endTransaction(tid, true);

		//verify that nothing happens if no overrides are requested
		assertTrue(equalPcodeOpArrays(calldsUnmodified, callds.getPcode()));
		assertTrue(equalPcodeOpArrays(calldsUnmodified, callds.getPcode(false)));
		assertTrue(equalPcodeOpArrays(callUnmodified, call.getPcode()));
		assertTrue(equalPcodeOpArrays(callUnmodified, call.getPcode(false)));

		//verify that requesting overrides on the instruction produces the same pcode 
		//that was produced before the override was applied
		assertTrue(equalPcodeOpArrays(cornerCase, callds.getPcode(true)));

		//verify that the override does apply to the instruction in the delay slot
		//when its pcode is generated directly
		PcodeOp[] overriddenCall = call.getPcode(true);
		assertTrue(equalPcodeOps(overriddenCall[0], callUnmodified[0]));
		assertTrue(overriddenCall[1].getOpcode() == PcodeOp.BRANCH);
		assertTrue(equalInputsAndOutput(overriddenCall[1], callUnmodified[1]));

		//remove existing flow override on call instruction
		//set flow override on callds instruction
		tid = program.startTransaction("test");
		call.setFlowOverride(FlowOverride.NONE);
		callds.setFlowOverride(FlowOverride.BRANCH);
		program.endTransaction(tid, true);

		//verify that pcode for instruction in delay slot is not affected by any overrides
		assertTrue(equalPcodeOpArrays(call.getPcode(true), call.getPcode(false)));
		assertTrue(equalPcodeOpArrays(call.getPcode(false), callUnmodified));

		//verify that requesting no overrides yields the unmodified pcode
		assertTrue(equalPcodeOpArrays(callds.getPcode(false), calldsUnmodified));

		//verify that requesting overrides results in pcode in which the second call instruction
		//(the one not in the delay slot) has been changed to a BRANCH 
		//verify no additional changes
		PcodeOp[] overriddenCallds = callds.getPcode(true);
		assertTrue(equalPcodeOps(overriddenCallds[0], calldsUnmodified[0]));
		assertTrue(equalPcodeOps(overriddenCallds[1], calldsUnmodified[1]));
		assertTrue(equalPcodeOps(overriddenCallds[2], calldsUnmodified[2]));
		assertTrue(overriddenCallds[3].getOpcode() == PcodeOp.BRANCH);
		assertTrue(equalInputsAndOutput(overriddenCallds[3], calldsUnmodified[3]));
	}
Tests that flow overrides: 
  1) do not apply to pcode generated by a delayslot directive
  2) do apply to instructions in a delay slot when their pcode is generated
     directly
  3) do apply to pcode not generated by a delayslot directive in instructions
     with a delay slot 
@throws AddressFormatException if {@code AddressSpace.getAddress} throws it
Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/program/model/pcode/PcodeEmitContextTest.java