Signed-off-by: Wei Yongjun <yj...@cn.fujitsu.com>

diff --git a/x86/realmode.c b/x86/realmode.c
index ce8fb18..0caf388 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1262,6 +1262,32 @@ void test_cbw(void)
                print_serial("cwde test 1: PASS\n");
 }
 
+void test_jcxz(void)
+{
+       struct regs inregs = { 0 }, outregs;
+
+       MK_INSN(jcxz, "jcxz 1f\n\t"
+                     "mov $0x1234, %eax\n\t"
+                     "1:\n\t");
+       MK_INSN(jecxz, "jecxz 1f\n\t"
+                      "mov $0x1234, %eax\n\t"
+                      "1:\n\t");
+
+       exec_in_big_real_mode(&inregs, &outregs,
+                       insn_jcxz, insn_jcxz_end - insn_jcxz);
+       if(!regs_equal(&inregs, &outregs, 0))
+               print_serial("JCXZ short Test 1: FAIL\n");
+       else
+               print_serial("JCXZ short Test 1: PASS\n");
+
+       exec_in_big_real_mode(&inregs, &outregs,
+                       insn_jecxz, insn_jecxz_end - insn_jecxz);
+       if(!regs_equal(&inregs, &outregs, 0))
+               print_serial("JECXZ short Test 1: FAIL\n");
+       else
+               print_serial("JECXZ short Test 1: PASS\n");
+}
+
 void realmode_start(void)
 {
        test_null();
@@ -1291,6 +1317,7 @@ void realmode_start(void)
        test_idiv();
        test_loopcc();
        test_cbw();
+       test_jcxz();
 
        exit(0);
 }
-- 
1.7.0.4


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to