aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr103721.c
blob: 6ec2e44b30f1cc2155373415c6576e35cac1c7f9 (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
// { dg-do run }
// { dg-options "-O2" }

int ipos = 0;
int f (int world)
{
  int searchVolume = world;
  int currentVolume = 0;
  while (currentVolume != searchVolume && searchVolume) {
    currentVolume = searchVolume;
    if (ipos != 0)
      searchVolume = 0;
    else
      searchVolume = 1;
  }
  return (currentVolume);
}
int main()
{
  const int i = f (1111);
  __builtin_printf ("%d\n", (int)(i));
  if (i != 1)
   __builtin_abort ();
  return 0;
}