summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/20020616-1.c
blob: 4630664d9579d05ffefce9ec237e27d384565099 (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
/* PR opt/6722 */
/* { dg-do run { target i?86-*-* } } */
/* { dg-options "-O2" } */

register int k asm("%ebx");

void __attribute__((noinline))
foo()
{
  k = 1;
}

void test()
{
  int i;
  for (i = 0; i < 10; i += k)
    {
      k = 0;
      foo();
    }
}

int main()
{
  int old = k;
  test();
  k = old;
  return 0;
}