summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr67329.c
blob: fec94eb86d304e88b5ecabc3b15ba55f97a51993 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile { target ia32 } } */
/* { dg-options "-O3 -fno-tree-fre -fno-tree-pre -fdump-tree-optimized -mtune=lakemount" } */

int
foo ()
{
  const int a[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
  int i, sum;

  sum = 0;
  for (i = 0; i < sizeof (a) / sizeof (*a); i++)
    sum += a[i];

  return sum;
}

/* After late unrolling the above loop completely DOM should be
   able to optimize this to return 28.  */

/* { dg-final { scan-tree-dump "return 28;" "optimized" } } */