summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wunreachable-8.c
blob: 81254ba3b2a596f92ff65effeccb779faa67b9b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile } */
/* { dg-options "-O2 -Wunreachable-code" } */
float Factorial(float X)
{
  float val = 1.0;
  int k,j;
  for (k=1; k < 5; k++)
    {
      val += 1.0; /* { dg-bogus "will never be executed" "" { xfail *-*-* } } */
    }
  return (val); /* { dg-bogus "will never be executed" } */
}

int main (void)
{
  float result;
  result=Factorial(2.1);
  return (0);
}