]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/uninit-8.c
Merge tree-ssa-20020619-branch into mainline.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / uninit-8.c
CommitLineData
47035bb8
ZW
1/* Uninitialized variable warning tests...
2 Inspired by part of optabs.c:expand_binop.
3 May be the same as uninit-1.c. */
4
5/* { dg-do compile } */
6/* { dg-options "-O -Wuninitialized" } */
7
8#include <limits.h>
9
10void
11add_bignums (int *out, int *x, int *y)
12{
13 int p, sum;
6de9cd9a 14 int carry; /* { dg-bogus "carry" "uninitialized variable warning" } */
47035bb8
ZW
15
16 p = 0;
17 for (; *x; x++, y++, out++, p++)
18 {
19 if (p)
20 sum = *x + *y + carry;
21 else
22 sum = *x + *y;
23
24 if (sum < 0)
25 {
26 carry = 1;
27 sum -= INT_MAX;
28 }
29 else
30 carry = 0;
31 }
32}