]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Even more regtests
authorJulian Seward <jseward@acm.org>
Wed, 5 Oct 2005 11:02:00 +0000 (11:02 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 5 Oct 2005 11:02:00 +0000 (11:02 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4867

none/tests/x86/Makefile.am
none/tests/x86/incdec_alt.c [new file with mode: 0644]
none/tests/x86/incdec_alt.stderr.exp [new file with mode: 0644]
none/tests/x86/incdec_alt.stdout.exp [new file with mode: 0644]
none/tests/x86/incdec_alt.vgtest [new file with mode: 0644]
none/tests/x86/lahf.c [new file with mode: 0644]
none/tests/x86/lahf.stderr.exp [new file with mode: 0644]
none/tests/x86/lahf.stdout.exp [new file with mode: 0644]
none/tests/x86/lahf.vgtest [new file with mode: 0644]

index 3ef6eb198f70370e23902d7fbc98577cf654d89b..a8c9e7ec25e2a0f619632a05b2efddc7760cd847 100644 (file)
@@ -13,10 +13,12 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
        fpu_lazy_eflags.vgtest \
        fxtract.stdout.exp fxtract.stderr.exp fxtract.vgtest \
        getseg.stdout.exp getseg.stderr.exp getseg.vgtest \
+       incdec_alt.stdout.exp incdec_alt.stderr.exp incdec_alt.vgtest \
        int.stderr.exp int.stdout.exp int.vgtest \
        $(addsuffix .stderr.exp,$(INSN_TESTS)) \
        $(addsuffix .stdout.exp,$(INSN_TESTS)) \
        $(addsuffix .vgtest,$(INSN_TESTS)) \
+       lahf.stdout.exp lahf.stderr.exp lahf.vgtest \
        looper.stderr.exp looper.stdout.exp looper.vgtest \
        pushpopseg.stderr.exp pushpopseg.stdout.exp pushpopseg.vgtest \
        sbbmisc.stderr.exp sbbmisc.stdout.exp sbbmisc.vgtest \
@@ -28,8 +30,8 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
 check_PROGRAMS = \
        badseg bt_everything bt_literal cmpxchg8b cpuid fpu_lazy_eflags \
        fxtract \
-       getseg $(INSN_TESTS) \
-       looper int pushpopseg sbbmisc \
+       getseg incdec_alt $(INSN_TESTS) \
+       lahf looper int pushpopseg sbbmisc \
        seg_override sigcontext smc1 yield
 
 AM_CFLAGS   = $(WERROR) -Winline -Wall -Wshadow \
diff --git a/none/tests/x86/incdec_alt.c b/none/tests/x86/incdec_alt.c
new file mode 100644 (file)
index 0000000..157bb16
--- /dev/null
@@ -0,0 +1,68 @@
+
+/* A test of the alternative (redundant) encodings for {inc,dec}{w,l}. */
+
+#include <stdio.h>
+
+int r1,r2,r3,r4,r5,r6,r7,r8,a1,a2;
+
+extern void foo ( void );
+asm("\n"
+"foo:\n"
+"\tpushl $0\n"
+"\tpopfl\n"
+"\tmovl a1,%eax\n"
+"\tmovl a2,%edx\n"
+
+/* inc %eax */
+"\t.byte 0xFF\n"
+"\t.byte 0xC0\n"
+
+"\tmovl %eax,r1\n"
+"\tpushfl\n"
+"\tpopl r2\n"
+
+/* inc %dx */
+"\t.byte 0x66\n"
+"\t.byte 0xFF\n"
+"\t.byte 0xC2\n"
+
+"\tmovl %edx,r3\n"
+"\tpushfl\n"
+"\tpopl r4\n"
+
+/* dec %edx */
+"\t.byte 0xFF\n"
+"\t.byte 0xCA\n"
+
+"\tmovl %edx,r5\n"
+"\tpushfl\n"
+"\tpopl r6\n"
+
+/* dec %ax */
+"\t.byte 0x66\n"
+"\t.byte 0xFF\n"
+"\t.byte 0xC8\n"
+
+"\tmovl %eax,r7\n"
+"\tpushfl\n"
+"\tpopl r8\n"
+
+"\tret\n"
+);
+
+int main ( void )
+{
+  a1 = 0x77777777;
+  a2 = 0x88888888;
+  r1=r2=r3=r4=r5=r6=r7=r8=0;
+  foo();
+  printf("0x%08x\n",r1);
+  printf("0x%08x\n",r2);
+  printf("0x%08x\n",r3);
+  printf("0x%08x\n",r4);
+  printf("0x%08x\n",r5);
+  printf("0x%08x\n",r6);
+  printf("0x%08x\n",r7);
+  printf("0x%08x\n",r8);
+  return 0;
+}
diff --git a/none/tests/x86/incdec_alt.stderr.exp b/none/tests/x86/incdec_alt.stderr.exp
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/none/tests/x86/incdec_alt.stdout.exp b/none/tests/x86/incdec_alt.stdout.exp
new file mode 100644 (file)
index 0000000..4d5a508
--- /dev/null
@@ -0,0 +1,8 @@
+0x77777778
+0x00000206
+0x88888889
+0x00000282
+0x88888888
+0x00000286
+0x77777777
+0x00000206
diff --git a/none/tests/x86/incdec_alt.vgtest b/none/tests/x86/incdec_alt.vgtest
new file mode 100644 (file)
index 0000000..a398e4e
--- /dev/null
@@ -0,0 +1 @@
+prog: incdec_alt
diff --git a/none/tests/x86/lahf.c b/none/tests/x86/lahf.c
new file mode 100644 (file)
index 0000000..cb6e572
--- /dev/null
@@ -0,0 +1,33 @@
+
+#include <stdio.h>
+
+extern int foo_1 ( void );
+asm("\n"
+"foo_1:\n"
+"\tpushl $0\n"
+"\tpopfl\n"
+"\tmovl $0xFFFFFFFF, %eax\n"
+"\tmovl $0x12345678, %edx\n"
+"\tsubl %eax, %edx\n"
+"\tlahf\n"
+"\tret\n"
+);
+
+extern int foo_0 ( void );
+asm("\n"
+"foo_0:\n"
+"\tpushl $0\n"
+"\tpopfl\n"
+"\tmovl $0x0, %eax\n"
+"\tmovl $0x12345678, %edx\n"
+"\tsubl %eax, %edx\n"
+"\tlahf\n"
+"\tret\n"
+);
+
+int main ( void )
+{
+  printf("0x%x\n", foo_0());
+  printf("0x%x\n", foo_1());
+  return 0;
+}
diff --git a/none/tests/x86/lahf.stderr.exp b/none/tests/x86/lahf.stderr.exp
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/none/tests/x86/lahf.stdout.exp b/none/tests/x86/lahf.stdout.exp
new file mode 100644 (file)
index 0000000..5a5a1ab
--- /dev/null
@@ -0,0 +1,2 @@
+0x600
+0xffff13ff
diff --git a/none/tests/x86/lahf.vgtest b/none/tests/x86/lahf.vgtest
new file mode 100644 (file)
index 0000000..71cccd2
--- /dev/null
@@ -0,0 +1 @@
+prog: lahf