1#define DEBUG 0
2#if DEBUG
3#include <stdio.h>
4#endif
5
6#define N 1000
7int a[N];
8
9static int __attribute__((noinline))
10foo (void)
11{
12  int j;
13  int i;
14
15  for (i = 0; i < N; i++)
16    for (j = 0; j < N; j++)
17      a[j] = a[i] + 1;
18
19  return a[0];
20}
21
22extern void abort ();
23
24int
25main (void)
26{
27  int i, res;
28
29  for (i = 0; i < N; i++)
30    a[i] = i;
31
32  res = foo ();
33
34#if DEBUG
35  fprintf (stderr, "res = %d \n", res);
36#endif
37
38  if (res != 1999)
39    abort ();
40
41  return 0;
42}
43
44/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" { xfail *-*-* } } } */
45/* { dg-final { cleanup-tree-dump "graphite" } } */
46