OSDN Git Service

2010-04-28 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / Wstrict-overflow-15.c
1 /* { dg-do compile } */
2 /* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=4" } */
3
4 /* Source: Ian Lance Taylor.  */
5
6 int
7 foo (int j)
8 {
9   int i;
10   int sum = 0;
11
12   for (i = 1; i < j; i += i)
13     sum += __builtin_abs (i); /* { dg-warning "assuming signed overflow does not occur" "" } */
14   return sum;
15 }