Merge with main truk.
[official-gcc.git] / gcc / testsuite / c-c++-common / uninit-17.c
blobfd773da78ad3019a11a99e336a30a691082b64e1
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wuninitialized -fno-ivopts" } */
4 inline int foo(int x)
6 return x;
8 static void bar(int a, int *ptr)
12 int b; /* { dg-message "declared" } */
13 if (b < 40) {
14 ptr[0] = b; /* { dg-warning "may be used uninitialized" } */
16 b += 1;
17 ptr++;
19 while (--a != 0);
21 void foobar(int a, int *ptr)
23 bar(foo(a), ptr);