diff mbox

Add push es instruction test in test harness

Message ID 20090816175141.GA8516@mohd-laptop (mailing list archive)
State New, archived
Headers show

Commit Message

Mohammed Gamal Aug. 16, 2009, 5:51 p.m. UTC
Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
---
 kvm/user/test/x86/realmode.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/kvm/user/test/x86/realmode.c b/kvm/user/test/x86/realmode.c
index 755b5d1..041f0a5 100644
--- a/kvm/user/test/x86/realmode.c
+++ b/kvm/user/test/x86/realmode.c
@@ -468,6 +468,22 @@  void test_long_jmp()
 		print_serial("Long JMP Test: FAIL\n");
 }
 
+void test_push_es()
+{
+	struct regs inregs = { 0 }, outregs;
+	
+	MK_INSN(push_es, "mov $0x231, %bx\n\t" //Just write a dummy value to see if it gets overwritten
+			 "mov %ax, %es\n\t"
+			 "push %es\n\t"
+			 "pop %bx \n\t"
+			 ); 
+	exec_in_big_real_mode(&inregs, &outregs,
+			      insn_push_es,
+			      insn_push_es_end - insn_push_es);
+	if(!regs_equal(&inregs, &outregs, R_AX|R_BX) ||  outregs.ebx != outregs.eax)
+		print_serial("Push ES Test: FAIL\n");
+}
+
 void test_null(void)
 {
 	struct regs inregs = { 0 }, outregs;
@@ -481,6 +497,7 @@  void start(void)
 	test_null();
 
 	test_shld();
+	test_push_es();
 	test_mov_imm();
 	test_cmp_imm();
 	test_add_imm();