* gcc.dg/stack-check-5.c: Skip with -fstack-protector.
[official-gcc.git] / gcc / testsuite / gcc.dg / uninit-8-O0.c
blobb386896c7eaad8969cff0e82cd9883aba3d387d0
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 "-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;