OSDN Git Service

2006-12-15 H.J. Lu <hongjiu.lu@intel.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / i386 / asm-3.c
1 /* PR inline-asm/6806 */
2 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
3 /* { dg-options "-O2" } */
4 /* { dg-skip-if "" { ilp32 } { "-fpic" "-fPIC" } { "" } } */
5 /* { dg-skip-if "PIC default" { *-*-darwin* } { "*" } { "" } } */
6
7 extern void abort (void);
8
9 volatile int out = 1;
10 volatile int a = 2;
11 volatile int b = 4;
12 volatile int c = 8;
13 volatile int d = 16;
14 volatile int e = 32;
15 volatile int f = 64;
16
17 int
18 main ()
19 {
20   asm volatile ("xorl %%eax, %%eax      \n\t"
21                 "xorl %%esi, %%esi      \n\t"
22                 "addl %1, %0            \n\t"
23                 "addl %2, %0            \n\t"
24                 "addl %3, %0            \n\t"
25                 "addl %4, %0            \n\t"
26                 "addl %5, %0            \n\t"
27                 "addl %6, %0"
28                 : "+r" (out)
29                 : "r" (a), "r" (b), "r" (c), "g" (d), "g" (e), "g" (f)
30                 : "%eax", "%esi");
31
32   if (out != 127)
33     abort ();
34
35   return 0;
36 }