summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/Wstrict-overflow-22.c
blob: 4b8438733e0a72b3e0e4a35a2f3ed8ae4a0ce619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do compile } */
/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=3" } */

/* Source: Ian Lance Taylor.  Based on strict-overflow-6.c.  */

/* We can only simplify the conditional when using strict overflow
   semantics.  */

int
foo (char* p)
{
  return p + 1000 < p; /* { dg-warning "assuming pointer wraparound does not occur" "correct warning" } */
}
OpenPOWER on IntegriCloud