PR c/64856
[official-gcc.git] / gcc / testsuite / gcc.dg / Wstrict-overflow-13.c
blob170d13777fac3ee0d5da805a0f3707ca273ccc6d
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 (depending on what
7 bigtime_test does), but at least we warn about it. */
9 extern int bigtime_test (int);
10 int
11 foo ()
13 int j;
14 for (j = 1; 0 < j; j *= 2) /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */
15 if (! bigtime_test (j))
16 return 1;
17 return 0;