summaryrefslogtreecommitdiff
path: root/memcheck
diff options
context:
space:
mode:
authorsewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2008-05-09 19:46:55 +0000
committersewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2008-05-09 19:46:55 +0000
commitc700172b64cb04f557427b1262d54ba985ad3c67 (patch)
treef2408ca9848e46eab8e7ea3684b10e7f661d3e54 /memcheck
parenta6fa9029443ed74c392d6062fc84be3d46bb3c0e (diff)
Add a test case for #157748.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8018 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'memcheck')
-rw-r--r--memcheck/tests/x86/Makefile.am5
-rw-r--r--memcheck/tests/x86/pushfw_x86.c22
-rw-r--r--memcheck/tests/x86/pushfw_x86.stderr.exp0
-rw-r--r--memcheck/tests/x86/pushfw_x86.stdout.exp1
-rw-r--r--memcheck/tests/x86/pushfw_x86.vgtest2
5 files changed, 29 insertions, 1 deletions
diff --git a/memcheck/tests/x86/Makefile.am b/memcheck/tests/x86/Makefile.am
index 36a6a399..3c5264b0 100644
--- a/memcheck/tests/x86/Makefile.am
+++ b/memcheck/tests/x86/Makefile.am
@@ -14,6 +14,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
$(addsuffix .vgtest,$(INSN_TESTS)) \
int3-x86.vgtest int3-x86.stderr.exp int3-x86.stdout.exp \
pushfpopf.stderr.exp pushfpopf.stdout.exp pushfpopf.vgtest \
+ pushfw_x86.vgtest pushfw_x86.stdout.exp pushfw_x86.stderr.exp \
pushpopmem.stderr.exp pushpopmem.stdout.exp pushpopmem.vgtest \
scalar.stderr.exp scalar.stderr.exp2 scalar.vgtest \
scalar_fork.stderr.exp scalar_fork.vgtest \
@@ -36,7 +37,9 @@ check_PROGRAMS = \
espindola2 \
int3-x86 \
scalar_exit_group scalar_fork scalar_supp scalar_vfork \
- fpeflags pushfpopf pushpopmem scalar sse_memory tronical \
+ fpeflags pushfpopf \
+ pushfw_x86 \
+ pushpopmem scalar sse_memory tronical \
more_x86_fp fprem xor-undef-x86
AM_CPPFLAGS = -I$(top_srcdir)/include
diff --git a/memcheck/tests/x86/pushfw_x86.c b/memcheck/tests/x86/pushfw_x86.c
new file mode 100644
index 00000000..74bc6846
--- /dev/null
+++ b/memcheck/tests/x86/pushfw_x86.c
@@ -0,0 +1,22 @@
+
+/* Test case for http://bugs.kde.org/show_bug.cgi?id=157748 */
+
+#include <stdio.h>
+
+int arr[3];
+
+int main ( void )
+{
+ /* eax points at arr[0] */
+ __asm__ __volatile__(
+ "movl %%esp,0(%%eax)\n\t"
+ "pushfw\n\t"
+ "movl %%esp,4(%%eax)\n\t"
+ "popfw\n\t"
+ "movl %%esp,8(%%eax)\n"
+ : /*out*/ : /*in*/ "a"(&arr) : /*trash*/ "memory","cc"
+ );
+
+ printf("%x %x %x\n", arr[0]-arr[0], arr[0]-arr[1], arr[0]-arr[2]);
+ return 0;
+}
diff --git a/memcheck/tests/x86/pushfw_x86.stderr.exp b/memcheck/tests/x86/pushfw_x86.stderr.exp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/memcheck/tests/x86/pushfw_x86.stderr.exp
diff --git a/memcheck/tests/x86/pushfw_x86.stdout.exp b/memcheck/tests/x86/pushfw_x86.stdout.exp
new file mode 100644
index 00000000..c24938bb
--- /dev/null
+++ b/memcheck/tests/x86/pushfw_x86.stdout.exp
@@ -0,0 +1 @@
+0 2 0
diff --git a/memcheck/tests/x86/pushfw_x86.vgtest b/memcheck/tests/x86/pushfw_x86.vgtest
new file mode 100644
index 00000000..392252fa
--- /dev/null
+++ b/memcheck/tests/x86/pushfw_x86.vgtest
@@ -0,0 +1,2 @@
+prog: pushfw_x86
+vgopts: -q