kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm testsuite: Add test for 'add imm' instruction
@ 2008-10-20 11:11 Guillaume Thouvenin
  2008-10-22 10:03 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Guillaume Thouvenin @ 2008-10-20 11:11 UTC (permalink / raw)
  To: kvm; +Cc: Avi Kivity

Add 'add' instruction test when source operand is an immediate (opcode
0x04 and 0x05) in real mode test harness.

Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
---
 realmode.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/user/test/x86/realmode.c b/user/test/x86/realmode.c
index 69ded37..1cb58b0 100644
--- a/user/test/x86/realmode.c
+++ b/user/test/x86/realmode.c
@@ -212,6 +212,26 @@ void test_cmp_imm(const struct regs *inregs, struct regs *outregs)
 		print_serial("cmp test 3: FAIL\n");
 }
 
+void test_add_imm(const struct regs *inregs, struct regs *outregs)
+{
+	MK_INSN(add_test1, "mov $0x43211234, %eax \n\t" 
+			   "add $0x12344321, %eax \n\t");
+	MK_INSN(add_test2, "mov $0x12, %eax \n\t"
+			   "add $0x21, %al\n\t");
+
+	exec_in_big_real_mode(inregs, outregs,
+			      insn_add_test1,
+			      insn_add_test1_end - insn_add_test1);
+	if (outregs->eax != 0x55555555)
+		print_serial("add test 1: FAIL\n");
+
+	exec_in_big_real_mode(inregs, outregs,
+			      insn_add_test2,
+			      insn_add_test2_end - insn_add_test2);
+	if (outregs->eax != 0x33)
+		print_serial("add test 2: FAIL\n");
+}
+
 void test_eflags_insn(struct regs *inregs, struct regs *outregs)
 {
 	MK_INSN(clc, "clc");
@@ -342,6 +362,7 @@ void start(void)
 	test_call(&inregs, &outregs);
 	test_mov_imm(&inregs, &outregs);
 	test_cmp_imm(&inregs, &outregs);
+	test_add_imm(&inregs, &outregs);
 	test_io(&inregs, &outregs);
 	test_eflags_insn(&inregs, &outregs);
 	exit(0);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kvm testsuite: Add test for 'add imm' instruction
  2008-10-20 11:11 [PATCH] kvm testsuite: Add test for 'add imm' instruction Guillaume Thouvenin
@ 2008-10-22 10:03 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2008-10-22 10:03 UTC (permalink / raw)
  To: Guillaume Thouvenin; +Cc: kvm

Guillaume Thouvenin wrote:
> Add 'add' instruction test when source operand is an immediate (opcode
> 0x04 and 0x05) in real mode test harness.
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-22 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-20 11:11 [PATCH] kvm testsuite: Add test for 'add imm' instruction Guillaume Thouvenin
2008-10-22 10:03 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).