aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-6.c
blob: 3b02374a18b64144f89c6f7f9f9e183c2d0bc6bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do run } */
/* { dg-options "-O2 -fdump-tree-optimized" } */

int main()
{
  int i;
  signed char result = 0;
  for (i = 0; i != 8000; ++i)
    {
      int tem = result;
      tem = tem + 2;
      result = tem;
    }
  if (__builtin_abs ((int)(signed char)((unsigned char ) result + 128)) != 0)
    __builtin_abort ();
  return 0;
}

/* SCEV constant propagation should be able to compute the overall effect
   of the loop.  */

/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */