summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr52904.c
blob: 2818c247b0aa26456e5b4f1812576727abf623ad (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 "-Wstrict-overflow -O2" } */
extern int foo (int);

int
wait_reading_process_output (void)
{
  int nfds = 0;
  int channel;

  for (channel = 0; channel < 1024; ++channel)
    {
      if (foo (channel))
	nfds++;
    }

  if (nfds < 0) /* { dg-bogus "assuming signed overflow does not occur" "" { xfail *-*-* } } */
    return 1;
  return 0;
}