|
From: <sv...@va...> - 2008-05-09 19:53:49
|
Author: sewardj Date: 2008-05-09 20:46:55 +0100 (Fri, 09 May 2008) New Revision: 8018 Log: Add a test case for #157748. Added: trunk/memcheck/tests/x86/pushfw_x86.c trunk/memcheck/tests/x86/pushfw_x86.stderr.exp trunk/memcheck/tests/x86/pushfw_x86.stdout.exp trunk/memcheck/tests/x86/pushfw_x86.vgtest Modified: trunk/memcheck/tests/x86/Makefile.am Modified: trunk/memcheck/tests/x86/Makefile.am =================================================================== --- trunk/memcheck/tests/x86/Makefile.am 2008-05-08 14:02:56 UTC (rev 8017) +++ trunk/memcheck/tests/x86/Makefile.am 2008-05-09 19:46:55 UTC (rev 8018) @@ -14,6 +14,7 @@ $(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 @@ 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 Added: trunk/memcheck/tests/x86/pushfw_x86.c =================================================================== --- trunk/memcheck/tests/x86/pushfw_x86.c (rev 0) +++ trunk/memcheck/tests/x86/pushfw_x86.c 2008-05-09 19:46:55 UTC (rev 8018) @@ -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; +} Added: trunk/memcheck/tests/x86/pushfw_x86.stderr.exp =================================================================== Added: trunk/memcheck/tests/x86/pushfw_x86.stdout.exp =================================================================== --- trunk/memcheck/tests/x86/pushfw_x86.stdout.exp (rev 0) +++ trunk/memcheck/tests/x86/pushfw_x86.stdout.exp 2008-05-09 19:46:55 UTC (rev 8018) @@ -0,0 +1 @@ +0 2 0 Added: trunk/memcheck/tests/x86/pushfw_x86.vgtest =================================================================== --- trunk/memcheck/tests/x86/pushfw_x86.vgtest (rev 0) +++ trunk/memcheck/tests/x86/pushfw_x86.vgtest 2008-05-09 19:46:55 UTC (rev 8018) @@ -0,0 +1,2 @@ +prog: pushfw_x86 +vgopts: -q |