Add new test to verify that the array index, limit, and stride are
[official-gcc.git] / gcc / testsuite / gcc.dg / Wstrict-overflow-12.c
blob177904db74a31a71ca2f5c19db1c196f0e975481
1 /* { dg-do compile } */
2 /* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=2" } */
4 /* Source: Ian Lance Taylor. Dual of no-strict-overflow-6.c. */
6 /* VRP test. This turns into an infinite loop when using strict
7 overflow semantics. */
9 int
10 foo ()
12 int i, bits;
13 for (i = 1, bits = 1; i > 0; i += i) /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */
14 ++bits;
15 return bits;