| 1 |
/* PR inline-asm/6806 */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-skip-if "" { ia32 && { ! nonpic } } } */ |
| 4 |
/* { dg-options "-O2" } */ |
| 5 |
|
| 6 |
extern void abort (void); |
| 7 |
|
| 8 |
volatile int out = 1; |
| 9 |
volatile int a = 2; |
| 10 |
volatile int b = 4; |
| 11 |
volatile int c = 8; |
| 12 |
volatile int d = 16; |
| 13 |
volatile int e = 32; |
| 14 |
volatile int f = 64; |
| 15 |
|
| 16 |
int |
| 17 |
main () |
| 18 |
{ |
| 19 |
asm volatile ("xorl %%eax, %%eax \n\t" |
| 20 |
"xorl %%esi, %%esi \n\t" |
| 21 |
"addl %1, %0 \n\t" |
| 22 |
"addl %2, %0 \n\t" |
| 23 |
"addl %3, %0 \n\t" |
| 24 |
"addl %4, %0 \n\t" |
| 25 |
"addl %5, %0 \n\t" |
| 26 |
"addl %6, %0" |
| 27 |
: "+r" (out) |
| 28 |
: "r" (a), "r" (b), "r" (c), "g" (d), "g" (e), "g" (f) |
| 29 |
: "%eax", "%esi"); |
| 30 |
|
| 31 |
if (out != 127) |
| 32 |
abort (); |
| 33 |
|
| 34 |
return 0; |
| 35 |
} |