aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/infinite-loop.c
blob: 25037a2027ec53a5f4822da1724840a61bba62df (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
/* { dg-do link } */
/* { dg-options "-O2" } */
void link_error (void);

void __attribute__ ((noinline,noipa))
foo(int a)
{
 int b = 0;

 while (1)
   {
     if (!a)
       break;
     b = 1;
   }

 if (b != 0)
   link_error ();
}

int
main()
{
  foo (0);
}