]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a regtest for the false-uninitialised-value-report bug fixed by
authorJulian Seward <jseward@acm.org>
Tue, 14 Nov 2006 18:36:02 +0000 (18:36 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 14 Nov 2006 18:36:02 +0000 (18:36 +0000)
vex r1675.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6354

memcheck/tests/x86/Makefile.am
memcheck/tests/x86/espindola2.c [new file with mode: 0644]
memcheck/tests/x86/espindola2.stderr.exp [new file with mode: 0644]
memcheck/tests/x86/espindola2.vgtest [new file with mode: 0644]

index 171d4fceb88d2dc42713e05e1b1cb08f053f54af..f132f7c6bf1027a84da5bee101ea959c7aad8f60 100644 (file)
@@ -6,6 +6,7 @@ INSN_TESTS = insn_basic insn_fpu insn_cmov insn_mmx insn_mmxext insn_sse insn_ss
 
 EXTRA_DIST = $(noinst_SCRIPTS) \
        bug133694.vgtest bug133694.stderr.exp bug133694.stdout.exp \
+       espindola2.vgtest espindola2.stderr.exp \
        fpeflags.stderr.exp fpeflags.vgtest \
        $(addsuffix .stderr.exp,$(INSN_TESTS)) \
        $(addsuffix .stdout.exp,$(INSN_TESTS)) \
@@ -27,6 +28,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
 
 check_PROGRAMS = \
        bug133694 \
+       espindola2 \
        scalar_exit_group scalar_fork scalar_supp scalar_vfork \
        fpeflags pushfpopf pushpopmem scalar sse_memory tronical \
        more_x86_fp fprem
diff --git a/memcheck/tests/x86/espindola2.c b/memcheck/tests/x86/espindola2.c
new file mode 100644 (file)
index 0000000..dc89f2d
--- /dev/null
@@ -0,0 +1,36 @@
+
+#include <stdlib.h>
+#include <assert.h>
+
+/* This should run without comment, but 3.2.1 (and presumably earlier)
+   give a false uninit-value warning.  This was fixed by vex r1675
+   which is a spec rule for COPY-CondP. */
+
+int main ( void )
+{
+  int* x = malloc(4);
+  assert(x);
+  __asm__ __volatile__(
+     "finit\n\t"
+     "ffree %%st(0)\n\t"
+     "ffree %%st(1)\n\t"
+     "ffree %%st(2)\n\t"
+     "ffree %%st(3)\n\t"
+     "ffree %%st(4)\n\t"
+     "ffree %%st(5)\n\t"
+     "ffree %%st(6)\n\t"
+     "ffree %%st(7)\n\t"
+     "andb $128, (%0)\n\t"
+     "fldz\n\t"
+     "fldz\n\t"
+     "fucompp\n\t"
+     "fnstsw %%ax\n\t"
+     "sahf\n\t"
+     "jp .Lfoobar\n"
+     ".Lfoobar:\n\t"
+     "nop"
+     : : "r"(x) : "eax", "cc"
+  );
+  free(x);
+  return 0;
+}
diff --git a/memcheck/tests/x86/espindola2.stderr.exp b/memcheck/tests/x86/espindola2.stderr.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/memcheck/tests/x86/espindola2.vgtest b/memcheck/tests/x86/espindola2.vgtest
new file mode 100644 (file)
index 0000000..d038fd5
--- /dev/null
@@ -0,0 +1,2 @@
+prog: espindola2
+vgopts: -q