aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60902.c
blob: b81dcd76f37aa82586c7bbfbb17d1c750a6bbc7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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);
}