@@ -865,6 +865,28 @@ void test_pusha_popa()
print_serial("Pusha/Popa Test2: PASS\n");
}
+void test_iret()
+{
+ struct regs inregs = { 0 }, outregs;
+
+ MK_INSN(iret, "pushf\n\t"
+ "pushl %cs\n\t"
+ "call 1f\n\t" /* a near call will push eip onto the stack */
+ "jmp 2f\n\t"
+ "1:iret\n\t"
+ "2:\n\t"
+ );
+
+ exec_in_big_real_mode(&inregs, &outregs,
+ insn_iret,
+ insn_iret_end - insn_iret);
+
+ if (!regs_equal(&inregs, &outregs, R_AX))
+ print_serial("iret Test 1: FAIL\n");
+ else
+ print_serial("iret Test 1: PASS\n");
+}
+
void realmode_start(void)
{
test_null();
@@ -886,6 +908,7 @@ void realmode_start(void)
/* long jmp test uses call near so test it after testing call */
test_long_jmp();
test_xchg();
+ test_iret();
exit(0);
}