1 /* PR tree-optimization/31866 */
2 /* { dg-do compile { target alpha*-*-* cris-*-* crisv32-*-* i?86-*-* mmix-*-* powerpc*-*-* rs6000-*-* x86_64-*-* } } */
3 /* { dg-options "-O2" } */
4 
5 #if defined (__alpha__)
6 # define REG "$1"
7 #elif defined (__CRIS__)
8 # define REG "r10"
9 #elif defined (__i386__)
10 # define REG "%eax"
11 #elif defined (__MMIX__)
12 # define REG "$8"
13 #elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) \
14 	|| defined (__POWERPC__) || defined (PPC) || defined (_IBMR2)
15 # define REG "6"
16 #elif defined (__x86_64__)
17 # define REG "rax"
18 #endif
19 
20 long int
foo(void)21 foo (void)
22 {
23   unsigned long int s;
24   long int a = (long int) 0;
25   register long int r asm (REG) = a;
26   asm ("" : "=r" (s) : "0" (r));
27   return s;
28 }
29