summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/strict-overflow-5.c
blob: 26e0174ba6a1622291c8a43eff1b3f8e5e3c66a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */
/* { dg-options "-fstrict-overflow -O2 -fdump-tree-final_cleanup" } */

/* We can only unroll when using strict overflow semantics.  */

int foo (int i)
{
  int index;
  int r=0;
 
  for (index = i; index <= i+4; index+=2) 
    r++;
 
  return r;
}

/* { dg-final { scan-tree-dump-times "r = 3" 1 "final_cleanup" } } */
/* { dg-final { cleanup-tree-dump "final_cleanup" } } */

OpenPOWER on IntegriCloud