Regtest for #135421 (long-form encoding of 'push{l,w} %reg')

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6360
This commit is contained in:
Julian Seward 2006-11-18 23:00:23 +00:00
parent 4bcb6276b1
commit 86b6d06695
5 changed files with 44 additions and 0 deletions

View File

@ -11,6 +11,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
bug125959-x86.stderr.exp bug125959-x86.stdout.exp bug125959-x86.vgtest \
bug126147-x86.stderr.exp bug126147-x86.stdout.exp bug126147-x86.vgtest \
bug132813-x86.stderr.exp bug132813-x86.stdout.exp bug132813-x86.vgtest \
bug135421-x86.stderr.exp bug135421-x86.stdout.exp bug135421-x86.vgtest \
cpuid.stderr.exp cpuid.stdout.exp cpuid.vgtest \
cmpxchg8b.stderr.exp cmpxchg8b.stdout.exp cmpxchg8b.vgtest \
faultstatus.disabled faultstatus.stderr.exp \
@ -40,6 +41,7 @@ check_PROGRAMS = \
bug125959-x86 \
bug126147-x86 \
bug132813-x86 \
bug135421-x86 \
cmpxchg8b cpuid \
faultstatus fcmovnu fpu_lazy_eflags fxtract \
getseg incdec_alt $(INSN_TESTS) \

View File

@ -0,0 +1,29 @@
/* Test for long-form encodings of push %reg */
#include <stdio.h>
int foo ( int x )
{
int block[2];
block[0] = x;
block[1] = 0;
__asm__ __volatile__(
"movl $0,%%edi\n\t"
"movl $0,%%esi\n\t"
"movl %0,%%edi\n\t"
".byte 0xFF,0xF7\n\t" /*pushl %edi */
"popl %%esi\n\t"
"movl %%esi, %1"
: : /*in*/ "m"(block[0]), "m"(block[1]) : "esi","edi","memory"
);
return block[1];
}
int main ( void )
{
int i;
for (i = 0; i < 100000000; i += 11111111)
printf("%d %d\n",i,foo(i));
return 0;
}

View File

@ -0,0 +1,2 @@

View File

@ -0,0 +1,10 @@
0 0
11111111 11111111
22222222 22222222
33333333 33333333
44444444 44444444
55555555 55555555
66666666 66666666
77777777 77777777
88888888 88888888
99999999 99999999

View File

@ -0,0 +1 @@
prog: bug135421-x86