Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/Wstrict-overflow-11.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-do compile } */ | |
2 /* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=1" } */ | |
3 | |
4 /* Based on strict-overflow-5.c. */ | |
5 | |
6 /* We can only unroll when using strict overflow semantics. But we | |
7 don't issue a warning for relying on undefined overflow in | |
8 loops. */ | |
9 | |
10 int foo (int i) | |
11 { | |
12 int index; | |
13 int r=0; | |
14 | |
15 for (index = i; index <= i+4; index+=2) | |
16 r++; | |
17 | |
18 return r; | |
19 } |