]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add regtest against vex cse failure that surfaced in 3.2.2.
authorJulian Seward <jseward@acm.org>
Mon, 29 Jan 2007 00:52:43 +0000 (00:52 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 29 Jan 2007 00:52:43 +0000 (00:52 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6557

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

index 6c7521068c74c8bba5e56cf3ae37bc09b65f8c99..bee3194702918f6d0e138343adfa3c7fc5ed7d7f 100644 (file)
@@ -15,6 +15,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
        bug137714-x86.stderr.exp bug137714-x86.stdout.exp bug137714-x86.vgtest \
        cpuid.stderr.exp cpuid.stdout.exp cpuid.vgtest \
        cmpxchg8b.stderr.exp cmpxchg8b.stdout.exp cmpxchg8b.vgtest \
+       cse_fail.stderr.exp cse_fail.stdout.exp cse_fail.vgtest \
        faultstatus.disabled faultstatus.stderr.exp \
        fcmovnu.vgtest fcmovnu.stderr.exp fcmovnu.stdout.exp \
        fpu_lazy_eflags.stderr.exp fpu_lazy_eflags.stdout.exp \
@@ -44,7 +45,7 @@ check_PROGRAMS = \
        bug132813-x86 \
        bug135421-x86 \
        bug137714-x86 \
-       cmpxchg8b cpuid \
+       cmpxchg8b cpuid cse_fail \
        faultstatus fcmovnu fpu_lazy_eflags fxtract \
        getseg incdec_alt $(INSN_TESTS) \
        jcxz \
diff --git a/none/tests/x86/cse_fail.c b/none/tests/x86/cse_fail.c
new file mode 100644 (file)
index 0000000..488963f
--- /dev/null
@@ -0,0 +1,62 @@
+
+/* This isn't really an x86 specific test.  It checks for an
+   iropt CSE failure that appeared in 3.2.2:
+
+ex: the `impossible' happened:
+   eqIRConst
+vex storage: T total 68337344 bytes allocated
+
+valgrind: the 'impossible' happened:
+   LibVEX called failure_exit().
+==23986==    at 0x38017803: report_and_quit (m_libcassert.c:136)
+==23986==    by 0x38017941: panic (m_libcassert.c:210)
+==23986==    by 0x38017997: vgPlain_core_panic_at (m_libcassert.c:215)
+==23986==    by 0x380179B5: vgPlain_core_panic (m_libcassert.c:220)
+==23986==    by 0x3802A650: failure_exit (m_translate.c:487)
+==23986==    by 0x38071678: vpanic (vex_util.c:225)
+==23986==    by 0x3806A1B0: eqIRConst (irdefs.c:2576)
+==23986==    by 0x3810BB84: do_cse_BB (iropt.c:2279)
+==23986==    by 0x3810CBBD: do_iropt_BB (iropt.c:4208)
+==23986==    by 0x3807010B: LibVEX_Translate (vex_main.c:478)
+==23986==    by 0x38029365: vgPlain_translate (m_translate.c:1097)
+==23986==    by 0x38037610: vgPlain_scheduler (scheduler.c:693)
+==23986==    by 0x38052FBE: run_a_thread_NORETURN (syswrap-linux.c:87)
+*/
+
+#include <stdio.h>
+
+int main ( void )
+{
+   /* This bombs 3.2.2 w/ V128 non-match in eqIRConst. */
+   printf("V128 cse:\n");
+   __asm__ __volatile__(
+      "pxor   %%xmm0,%%xmm0\n\t"
+      "movaps %%xmm1,%%xmm2\n\t"
+      "addps  %%xmm0,%%xmm1\n\t"
+      "addps  %%xmm0,%%xmm2\n\t"
+      "addps  %%xmm1,%%xmm2\n\t"
+      : : : "xmm0","xmm1", "st"
+   );
+
+   /* This ought to cause it to fail w/ F64i non-match in eqIRConst,
+      but it doesn't.  I don't understand why not. */
+   printf("F64i cse:\n");
+   __asm__ __volatile__(
+      "fninit\n\t"
+
+      "fldz\n\t"
+      "fldz\n\t"
+      "fstp %%st(4)\n\t"
+      "fstp %%st(3)\n\t"
+
+      "fldpi\n\t"
+      "fldpi\n\t"
+      "fsqrt\n\t"
+      "fxch %%st(1)\n\t"
+      "fsqrt\n\t"
+      "faddp %%st(1)\n\t"
+
+      : : : "st"
+      );
+   return 0;
+}
diff --git a/none/tests/x86/cse_fail.stderr.exp b/none/tests/x86/cse_fail.stderr.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/none/tests/x86/cse_fail.stdout.exp b/none/tests/x86/cse_fail.stdout.exp
new file mode 100644 (file)
index 0000000..879d665
--- /dev/null
@@ -0,0 +1,2 @@
+V128 cse:
+F64i cse:
diff --git a/none/tests/x86/cse_fail.vgtest b/none/tests/x86/cse_fail.vgtest
new file mode 100644 (file)
index 0000000..13e64bd
--- /dev/null
@@ -0,0 +1,3 @@
+prog: cse_fail
+prereq: ../../../tests/cputest x86-sse
+vgopts: -q