* testsuite/libgomp.fortran/vla7.f90: Add -w to options.
[official-gcc.git] / gcc / testsuite / gcc.dg / uninit-8.c
blob98700f4aa1fd2c5b829c9a1a7acc30b5349c82bf
1 /* Uninitialized variable warning tests...
2 Inspired by part of optabs.c:expand_binop.
3 May be the same as uninit-1.c. */
5 /* { dg-do compile } */
6 /* { dg-options "-O -Wuninitialized" } */
8 #include <limits.h>
10 void
11 add_bignums (int *out, int *x, int *y)
13 int p, sum;
14 int carry; /* { dg-bogus "carry" "uninitialized variable warning" } */
16 p = 0;
17 for (; *x; x++, y++, out++, p++)
19 if (p)
20 sum = *x + *y + carry;
21 else
22 sum = *x + *y;
24 if (sum < 0)
26 carry = 1;
27 sum -= INT_MAX;
29 else
30 carry = 0;