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

/* Don't warn about an overflow when threading jumps.  We used to get
   a warning from comparing bounds generated by VRP.  */

int
bar(int a, int b, int n)
{
  if (b > a)
    n = a - b;
  if (a >= b)
    n = 1;
  return n;
}