From: Julian Seward Date: Wed, 5 Oct 2005 11:02:00 +0000 (+0000) Subject: Even more regtests X-Git-Tag: svn/VALGRIND_3_1_0~363 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2ed402a2657e8e640304cb7e4d02aeb1a6bfe05;p=thirdparty%2Fvalgrind.git Even more regtests git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4867 --- diff --git a/none/tests/x86/Makefile.am b/none/tests/x86/Makefile.am index 3ef6eb198f..a8c9e7ec25 100644 --- a/none/tests/x86/Makefile.am +++ b/none/tests/x86/Makefile.am @@ -13,10 +13,12 @@ EXTRA_DIST = $(noinst_SCRIPTS) \ fpu_lazy_eflags.vgtest \ fxtract.stdout.exp fxtract.stderr.exp fxtract.vgtest \ getseg.stdout.exp getseg.stderr.exp getseg.vgtest \ + incdec_alt.stdout.exp incdec_alt.stderr.exp incdec_alt.vgtest \ int.stderr.exp int.stdout.exp int.vgtest \ $(addsuffix .stderr.exp,$(INSN_TESTS)) \ $(addsuffix .stdout.exp,$(INSN_TESTS)) \ $(addsuffix .vgtest,$(INSN_TESTS)) \ + lahf.stdout.exp lahf.stderr.exp lahf.vgtest \ looper.stderr.exp looper.stdout.exp looper.vgtest \ pushpopseg.stderr.exp pushpopseg.stdout.exp pushpopseg.vgtest \ sbbmisc.stderr.exp sbbmisc.stdout.exp sbbmisc.vgtest \ @@ -28,8 +30,8 @@ EXTRA_DIST = $(noinst_SCRIPTS) \ check_PROGRAMS = \ badseg bt_everything bt_literal cmpxchg8b cpuid fpu_lazy_eflags \ fxtract \ - getseg $(INSN_TESTS) \ - looper int pushpopseg sbbmisc \ + getseg incdec_alt $(INSN_TESTS) \ + lahf looper int pushpopseg sbbmisc \ seg_override sigcontext smc1 yield AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow \ diff --git a/none/tests/x86/incdec_alt.c b/none/tests/x86/incdec_alt.c new file mode 100644 index 0000000000..157bb16972 --- /dev/null +++ b/none/tests/x86/incdec_alt.c @@ -0,0 +1,68 @@ + +/* A test of the alternative (redundant) encodings for {inc,dec}{w,l}. */ + +#include + +int r1,r2,r3,r4,r5,r6,r7,r8,a1,a2; + +extern void foo ( void ); +asm("\n" +"foo:\n" +"\tpushl $0\n" +"\tpopfl\n" +"\tmovl a1,%eax\n" +"\tmovl a2,%edx\n" + +/* inc %eax */ +"\t.byte 0xFF\n" +"\t.byte 0xC0\n" + +"\tmovl %eax,r1\n" +"\tpushfl\n" +"\tpopl r2\n" + +/* inc %dx */ +"\t.byte 0x66\n" +"\t.byte 0xFF\n" +"\t.byte 0xC2\n" + +"\tmovl %edx,r3\n" +"\tpushfl\n" +"\tpopl r4\n" + +/* dec %edx */ +"\t.byte 0xFF\n" +"\t.byte 0xCA\n" + +"\tmovl %edx,r5\n" +"\tpushfl\n" +"\tpopl r6\n" + +/* dec %ax */ +"\t.byte 0x66\n" +"\t.byte 0xFF\n" +"\t.byte 0xC8\n" + +"\tmovl %eax,r7\n" +"\tpushfl\n" +"\tpopl r8\n" + +"\tret\n" +); + +int main ( void ) +{ + a1 = 0x77777777; + a2 = 0x88888888; + r1=r2=r3=r4=r5=r6=r7=r8=0; + foo(); + printf("0x%08x\n",r1); + printf("0x%08x\n",r2); + printf("0x%08x\n",r3); + printf("0x%08x\n",r4); + printf("0x%08x\n",r5); + printf("0x%08x\n",r6); + printf("0x%08x\n",r7); + printf("0x%08x\n",r8); + return 0; +} diff --git a/none/tests/x86/incdec_alt.stderr.exp b/none/tests/x86/incdec_alt.stderr.exp new file mode 100644 index 0000000000..139597f9cb --- /dev/null +++ b/none/tests/x86/incdec_alt.stderr.exp @@ -0,0 +1,2 @@ + + diff --git a/none/tests/x86/incdec_alt.stdout.exp b/none/tests/x86/incdec_alt.stdout.exp new file mode 100644 index 0000000000..4d5a50802e --- /dev/null +++ b/none/tests/x86/incdec_alt.stdout.exp @@ -0,0 +1,8 @@ +0x77777778 +0x00000206 +0x88888889 +0x00000282 +0x88888888 +0x00000286 +0x77777777 +0x00000206 diff --git a/none/tests/x86/incdec_alt.vgtest b/none/tests/x86/incdec_alt.vgtest new file mode 100644 index 0000000000..a398e4e129 --- /dev/null +++ b/none/tests/x86/incdec_alt.vgtest @@ -0,0 +1 @@ +prog: incdec_alt diff --git a/none/tests/x86/lahf.c b/none/tests/x86/lahf.c new file mode 100644 index 0000000000..cb6e572d05 --- /dev/null +++ b/none/tests/x86/lahf.c @@ -0,0 +1,33 @@ + +#include + +extern int foo_1 ( void ); +asm("\n" +"foo_1:\n" +"\tpushl $0\n" +"\tpopfl\n" +"\tmovl $0xFFFFFFFF, %eax\n" +"\tmovl $0x12345678, %edx\n" +"\tsubl %eax, %edx\n" +"\tlahf\n" +"\tret\n" +); + +extern int foo_0 ( void ); +asm("\n" +"foo_0:\n" +"\tpushl $0\n" +"\tpopfl\n" +"\tmovl $0x0, %eax\n" +"\tmovl $0x12345678, %edx\n" +"\tsubl %eax, %edx\n" +"\tlahf\n" +"\tret\n" +); + +int main ( void ) +{ + printf("0x%x\n", foo_0()); + printf("0x%x\n", foo_1()); + return 0; +} diff --git a/none/tests/x86/lahf.stderr.exp b/none/tests/x86/lahf.stderr.exp new file mode 100644 index 0000000000..139597f9cb --- /dev/null +++ b/none/tests/x86/lahf.stderr.exp @@ -0,0 +1,2 @@ + + diff --git a/none/tests/x86/lahf.stdout.exp b/none/tests/x86/lahf.stdout.exp new file mode 100644 index 0000000000..5a5a1abcb5 --- /dev/null +++ b/none/tests/x86/lahf.stdout.exp @@ -0,0 +1,2 @@ +0x600 +0xffff13ff diff --git a/none/tests/x86/lahf.vgtest b/none/tests/x86/lahf.vgtest new file mode 100644 index 0000000000..71cccd2fe5 --- /dev/null +++ b/none/tests/x86/lahf.vgtest @@ -0,0 +1 @@ +prog: lahf