gcc/testsuite/gcc.target/i386/pr60902.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | extern void abort (); |
| 4 | extern void exit (int); |
| 5 | |
| 6 | int x; |
| 7 | |
| 8 | void |
| 9 | foo() |
| 10 | { |
| 11 | static int count; |
| 12 | count++; |
| 13 | if (count > 1) |
| 14 | abort (); |
| 15 | } |
| 16 | |
| 17 | static inline int |
| 18 | frob () |
| 19 | { |
| 20 | int a; |
| 21 | __asm__ ("mov %1, %0\n\t" : "=r" (a) : "m" (x)); |
| 22 | x++; |
| 23 | return a; |
| 24 | } |
| 25 | |
| 26 | int |
| 27 | main () |
| 28 | { |
| 29 | int i; |
| 30 | for (i = 0; i < 10 && frob () == 0; i++) |
| 31 | foo(); |
| 32 | exit (0); |
| 33 | } |