summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr34088.c
blob: 88a635d2d2035b6a83f4a55adf57a0e87041c379 (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
/* PR middle-end/34088 */
/* { dg-do compile } */
/* { dg-options "-O -Wall -Werror" } */

int F0 (int);
int F1 (int t) { return F0(t); }
int F2 (int t) { return F0(t); }

extern int X[];
static inline int foo(int i)
{
  return X[i];
}

int bar(int* p)
{
  int i;

  while ( ({ if (foo(*p) && foo(*p)); p; }) );

  return i;	/* { dg-error "is used uninitialized" } */
}

/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */