diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/i386/pr60902.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.target/i386/pr60902.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60902.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60902.c new file mode 100644 index 000000000..b81dcd76f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60902.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ +extern void abort (); +extern void exit (int); + +int x; + +foo() +{ + static int count; + count++; + if (count > 1) + abort (); +} + +static inline int +frob () +{ + int a; + __asm__ ("mov %1, %0\n\t" : "=r" (a) : "m" (x)); + x++; + return a; +} + +int +main () +{ + int i; + for (i = 0; i < 10 && frob () == 0; i++) + foo(); + exit (0); +} |