]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Regtest for #132813 (Assertion at priv/guest-x86/toIR.c:652 fails)
authorJulian Seward <jseward@acm.org>
Mon, 28 Aug 2006 18:09:46 +0000 (18:09 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 28 Aug 2006 18:09:46 +0000 (18:09 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6034

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

index 4ea5ba9e7b6b737bda76278c10b083ab2cb7bf95..a8c5ec7518cce5d681c75a0d528aa9c91a4f441e 100644 (file)
@@ -8,6 +8,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
        badseg.stderr.exp badseg.stdout.exp badseg.vgtest \
        bt_everything.stderr.exp bt_everything.stdout.exp bt_everything.vgtest \
        bt_literal.stderr.exp bt_literal.stdout.exp bt_literal.vgtest \
+       bug132813-x86.stderr.exp bug132813-x86.stdout.exp bug132813-x86.vgtest \
        cpuid.stderr.exp cpuid.stdout.exp cpuid.vgtest \
        cmpxchg8b.stderr.exp cmpxchg8b.stdout.exp cmpxchg8b.vgtest \
        faultstatus.disabled faultstatus.stderr.exp \
@@ -32,7 +33,9 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
        yield.stderr.exp yield.stdout.exp yield.disabled
 
 check_PROGRAMS = \
-       badseg bt_everything bt_literal cmpxchg8b cpuid \
+       badseg bt_everything bt_literal \
+       bug132813-x86 \
+       cmpxchg8b cpuid \
        faultstatus fcmovnu fpu_lazy_eflags fxtract \
        getseg incdec_alt $(INSN_TESTS) \
        lahf looper movx int pushpopseg sbbmisc \
diff --git a/none/tests/x86/bug132813-x86.c b/none/tests/x86/bug132813-x86.c
new file mode 100644 (file)
index 0000000..8e387ac
--- /dev/null
@@ -0,0 +1,170 @@
+
+#include <stdio.h>
+
+void do_pushb_pos ( void )
+{
+   unsigned int block[3];
+   __asm__ __volatile__ (
+      "movl  %0, %%edx\n\t"
+      "pushl $0x55555555\n\t"
+      "movl  %%esp, 0(%%edx)\n\t"
+      ".byte 0x6A,0x22\n\t"
+      "movl  %%esp, 4(%%edx)\n\t"
+      "popl  %%eax\n\t"
+      "movl  %%eax,8(%%edx)\n\t"
+      "movl  0(%%edx),%%esp\n\t"
+      "addl  $4, %%esp"
+      : : "r"(&block) : "eax","edx","cc","memory"
+    );
+    printf("  pushb_pos: delta %d, top32 0x%08x\n",
+           block[0] - block[1], block[2]);
+}
+
+void do_pushb_neg ( void )
+{
+   unsigned int block[3];
+   __asm__ __volatile__ (
+      "movl  %0, %%edx\n\t"
+      "pushl $0x55555555\n\t"
+      "movl  %%esp, 0(%%edx)\n\t"
+      ".byte 0x6A,0xEE\n\t"
+      "movl  %%esp, 4(%%edx)\n\t"
+      "popl  %%eax\n\t"
+      "movl  %%eax,8(%%edx)\n\t"
+      "movl  0(%%edx),%%esp\n\t"
+      "addl  $4, %%esp"
+      : : "r"(&block) : "eax","edx","cc","memory"
+    );
+    printf("  pushb_neg: delta %d, top32 0x%08x\n",
+           block[0] - block[1], block[2]);
+}
+
+void do_pushw_pos ( void )
+{
+   unsigned int block[3];
+   __asm__ __volatile__ (
+      "movl  %0, %%edx\n\t"
+      "pushl $0x55555555\n\t"
+      "movl  %%esp, 0(%%edx)\n\t"
+      "pushw $0x3344\n\t"
+      "movl  %%esp, 4(%%edx)\n\t"
+      "popl  %%eax\n\t"
+      "movl  %%eax,8(%%edx)\n\t"
+      "movl  0(%%edx),%%esp\n\t"
+      "addl  $4, %%esp"
+      : : "r"(&block) : "eax","edx","cc","memory"
+    );
+    printf("  pushw_neg: delta %d, top32 0x%08x\n",
+           block[0] - block[1], block[2]);
+}
+
+void do_pushw_neg ( void )
+{
+   unsigned int block[3];
+   __asm__ __volatile__ (
+      "movl  %0, %%edx\n\t"
+      "pushl $0x55555555\n\t"
+      "movl  %%esp, 0(%%edx)\n\t"
+      "pushw $0xDDCC\n\t"
+      "movl  %%esp, 4(%%edx)\n\t"
+      "popl  %%eax\n\t"
+      "movl  %%eax,8(%%edx)\n\t"
+      "movl  0(%%edx),%%esp\n\t"
+      "addl  $4, %%esp"
+      : : "r"(&block) : "eax","edx","cc","memory"
+    );
+    printf("  pushw_pos: delta %d, top32 0x%08x\n",
+           block[0] - block[1], block[2]);
+}
+
+void do_pushl_pos ( void )
+{
+   unsigned int block[3];
+   __asm__ __volatile__ (
+      "movl  %0, %%edx\n\t"
+      "pushl $0x55555555\n\t"
+      "movl  %%esp, 0(%%edx)\n\t"
+      "pushl $0x67675656\n\t"
+      "movl  %%esp, 4(%%edx)\n\t"
+      "popl  %%eax\n\t"
+      "movl  %%eax,8(%%edx)\n\t"
+      "movl  0(%%edx),%%esp\n\t"
+      "addl  $4, %%esp"
+      : : "r"(&block) : "eax","edx","cc","memory"
+    );
+    printf("  pushl_pos: delta %d, top32 0x%08x\n",
+           block[0] - block[1], block[2]);
+}
+
+void do_pushl_neg ( void )
+{
+   unsigned int block[3];
+   __asm__ __volatile__ (
+      "movl  %0, %%edx\n\t"
+      "pushl $0x55555555\n\t"
+      "movl  %%esp, 0(%%edx)\n\t"
+      "pushl $0x98988787\n\t"
+      "movl  %%esp, 4(%%edx)\n\t"
+      "popl  %%eax\n\t"
+      "movl  %%eax,8(%%edx)\n\t"
+      "movl  0(%%edx),%%esp\n\t"
+      "addl  $4, %%esp"
+      : : "r"(&block) : "eax","edx","cc","memory"
+    );
+    printf("  pushl_neg: delta %d, top32 0x%08x\n",
+           block[0] - block[1], block[2]);
+}
+
+
+void do_66pushb_pos ( void )
+{
+   unsigned int block[3];
+   __asm__ __volatile__ (
+      "movl  %0, %%edx\n\t"
+      "pushl $0x55555555\n\t"
+      "movl  %%esp, 0(%%edx)\n\t"
+      ".byte 0x66,0x6A,0x22\n\t"
+      "movl  %%esp, 4(%%edx)\n\t"
+      "popl  %%eax\n\t"
+      "movl  %%eax,8(%%edx)\n\t"
+      "movl  0(%%edx),%%esp\n\t"
+      "addl  $4, %%esp"
+      : : "r"(&block) : "eax","edx","cc","memory"
+    );
+    printf("66pushb_pos: delta %d, top32 0x%08x\n",
+           block[0] - block[1], block[2]);
+}
+
+void do_66pushb_neg ( void )
+{
+   unsigned int block[3];
+   __asm__ __volatile__ (
+      "movl  %0, %%edx\n\t"
+      "pushl $0x55555555\n\t"
+      "movl  %%esp, 0(%%edx)\n\t"
+      ".byte 0x66,0x6A,0xEE\n\t"
+      "movl  %%esp, 4(%%edx)\n\t"
+      "popl  %%eax\n\t"
+      "movl  %%eax,8(%%edx)\n\t"
+      "movl  0(%%edx),%%esp\n\t"
+      "addl  $4, %%esp"
+      : : "r"(&block) : "eax","edx","cc","memory"
+    );
+    printf("66pushb_neg: delta %d, top32 0x%08x\n",
+           block[0] - block[1], block[2]);
+}
+
+
+int main ( void )
+{
+  do_pushb_pos();
+  do_pushb_neg();
+  do_pushw_pos();
+  do_pushw_neg();
+  do_pushl_pos();
+  do_pushl_neg();
+
+  do_66pushb_pos();
+  do_66pushb_neg();
+  return 0;
+}
diff --git a/none/tests/x86/bug132813-x86.stderr.exp b/none/tests/x86/bug132813-x86.stderr.exp
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/none/tests/x86/bug132813-x86.stdout.exp b/none/tests/x86/bug132813-x86.stdout.exp
new file mode 100644 (file)
index 0000000..6941895
--- /dev/null
@@ -0,0 +1,8 @@
+  pushb_pos: delta 4, top32 0x00000022
+  pushb_neg: delta 4, top32 0xffffffee
+  pushw_neg: delta 2, top32 0x55553344
+  pushw_pos: delta 2, top32 0x5555ddcc
+  pushl_pos: delta 4, top32 0x67675656
+  pushl_neg: delta 4, top32 0x98988787
+66pushb_pos: delta 2, top32 0x55550022
+66pushb_neg: delta 2, top32 0x5555ffee
diff --git a/none/tests/x86/bug132813-x86.vgtest b/none/tests/x86/bug132813-x86.vgtest
new file mode 100644 (file)
index 0000000..9ddf0be
--- /dev/null
@@ -0,0 +1 @@
+prog: bug132813-x86