|
From: <sv...@va...> - 2006-05-12 14:24:23
|
Author: sewardj
Date: 2006-05-12 15:24:18 +0100 (Fri, 12 May 2006)
New Revision: 5891
Log:
Test x86 {push,pop}{w,l}.
Added:
trunk/memcheck/tests/x86/pushpopmem.c
trunk/memcheck/tests/x86/pushpopmem.stderr.exp
trunk/memcheck/tests/x86/pushpopmem.stdout.exp
trunk/memcheck/tests/x86/pushpopmem.vgtest
Modified:
trunk/memcheck/tests/x86/Makefile.am
Modified: trunk/memcheck/tests/x86/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/x86/Makefile.am 2006-05-09 18:46:01 UTC (rev 589=
0)
+++ trunk/memcheck/tests/x86/Makefile.am 2006-05-12 14:24:18 UTC (rev 589=
1)
@@ -10,6 +10,7 @@
$(addsuffix .stdout.exp,$(INSN_TESTS)) \
$(addsuffix .vgtest,$(INSN_TESTS)) \
pushfpopf.stderr.exp pushfpopf.stdout.exp pushfpopf.vgtest \
+ pushpopmem.stderr.exp pushpopmem.stdout.exp pushpopmem.vgtest \
scalar.stderr.exp scalar.stderr.exp2 scalar.vgtest \
scalar_fork.stderr.exp scalar_fork.vgtest \
scalar_exit_group.stderr.exp scalar_exit_group.stderr.exp2 \
@@ -25,7 +26,7 @@
=20
check_PROGRAMS =3D \
scalar_exit_group scalar_fork scalar_supp scalar_vfork \
- fpeflags pushfpopf scalar sse_memory tronical \
+ fpeflags pushfpopf pushpopmem scalar sse_memory tronical \
more_x86_fp fprem
=20
AM_CPPFLAGS =3D -I$(top_srcdir)/include
Added: trunk/memcheck/tests/x86/pushpopmem.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/x86/pushpopmem.c (rev 0)
+++ trunk/memcheck/tests/x86/pushpopmem.c 2006-05-12 14:24:18 UTC (rev 58=
91)
@@ -0,0 +1,62 @@
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+unsigned int do32 ( unsigned int x )
+{
+ unsigned int* y =3D malloc(sizeof(unsigned int));
+ unsigned int* z =3D malloc(sizeof(unsigned int));
+ unsigned int t;
+ assert(y);
+ assert(z);
+ y[0] =3D x;
+ __asm__ __volatile__(
+ "pushl %0\n\t"
+ "pushl %1\n\t"
+ "popl %%ebx\n\t"
+ "popl %%eax\n\t"
+ "pushl 0(%%eax)\n\t"
+ "popl 0(%%ebx)"
+ : /*OUT*/
+ : /*IN*/ "r"(y), "r"(z)
+ : /*TRASH*/ "memory", "eax", "ebx"
+ );
+ t =3D z[0];
+ free(y);
+ free(z);
+ return t;
+}
+
+unsigned short do16 ( unsigned short x )
+{
+ unsigned short* y =3D malloc(sizeof(unsigned short));
+ unsigned short* z =3D malloc(sizeof(unsigned short));
+ unsigned short t;
+ assert(y);
+ assert(z);
+ y[0] =3D x;
+ __asm__ __volatile__(
+ "pushl %0\n\t"
+ "pushl %1\n\t"
+ "popl %%ebx\n\t"
+ "popl %%eax\n\t"
+ "pushw 0(%%eax)\n\t"
+ "popw 0(%%ebx)"
+ : /*OUT*/
+ : /*IN*/ "r"(y), "r"(z)
+ : /*TRASH*/ "memory", "eax", "ebx"
+ );
+ t =3D z[0];
+ free(y);
+ free(z);
+ return t;
+}
+
+
+int main ( void )
+{
+ printf("do32: 0x%08X\n", do32(0xCafeBabe) );
+ printf("do16: 0x%08X\n", (unsigned int)do16(0xfeBa) );
+ return 0;
+}
Added: trunk/memcheck/tests/x86/pushpopmem.stderr.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Added: trunk/memcheck/tests/x86/pushpopmem.stdout.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/x86/pushpopmem.stdout.exp =
(rev 0)
+++ trunk/memcheck/tests/x86/pushpopmem.stdout.exp 2006-05-12 14:24:18 UT=
C (rev 5891)
@@ -0,0 +1,2 @@
+do32: 0xCAFEBABE
+do16: 0x0000FEBA
Added: trunk/memcheck/tests/x86/pushpopmem.vgtest
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/x86/pushpopmem.vgtest (r=
ev 0)
+++ trunk/memcheck/tests/x86/pushpopmem.vgtest 2006-05-12 14:24:18 UTC (r=
ev 5891)
@@ -0,0 +1,2 @@
+prog: pushpopmem
+vgopts: -q
|