Add 469782 to NEWS
[valgrind.git] / none / tests / x86 / incdec_alt.c
blobb8ff5c07e68b9f2bfc3f3d5e0ee01bb8f8b1a959
2 /* A test of the alternative (redundant) encodings for {inc,dec}{w,l}. */
4 #include "tests/asm.h"
5 #include <stdio.h>
7 int r1,r2,r3,r4,r5,r6,r7,r8,a1,a2;
9 extern void foo ( void );
10 asm("\n"
11 ".text\n"
12 VG_SYM(foo) ":\n"
13 "\tpushl $0\n"
14 "\tpopfl\n"
15 "\tmovl " VG_SYM(a1) ",%eax\n"
16 "\tmovl " VG_SYM(a2) ",%edx\n"
18 /* inc %eax */
19 "\t.byte 0xFF\n"
20 "\t.byte 0xC0\n"
22 "\tmovl %eax," VG_SYM(r1) "\n"
23 "\tpushfl\n"
24 "\tpopl " VG_SYM(r2) "\n"
26 /* inc %dx */
27 "\t.byte 0x66\n"
28 "\t.byte 0xFF\n"
29 "\t.byte 0xC2\n"
31 "\tmovl %edx," VG_SYM(r3) "\n"
32 "\tpushfl\n"
33 "\tpopl " VG_SYM(r4) "\n"
35 /* dec %edx */
36 "\t.byte 0xFF\n"
37 "\t.byte 0xCA\n"
39 "\tmovl %edx," VG_SYM(r5) "\n"
40 "\tpushfl\n"
41 "\tpopl " VG_SYM(r6) "\n"
43 /* dec %ax */
44 "\t.byte 0x66\n"
45 "\t.byte 0xFF\n"
46 "\t.byte 0xC8\n"
48 "\tmovl %eax," VG_SYM(r7) "\n"
49 "\tpushfl\n"
50 "\tpopl " VG_SYM(r8) "\n"
52 "\tret\n"
53 ".previous\n"
56 int main ( void )
58 a1 = 0x77777777;
59 a2 = 0x88888888;
60 r1=r2=r3=r4=r5=r6=r7=r8=0;
61 foo();
62 printf("0x%08x\n",r1);
63 printf("0x%08x\n",r2);
64 printf("0x%08x\n",r3);
65 printf("0x%08x\n",r4);
66 printf("0x%08x\n",r5);
67 printf("0x%08x\n",r6);
68 printf("0x%08x\n",r7);
69 printf("0x%08x\n",r8);
70 return 0;