1 /* { dg-require-effective-target size32plus } */
2 
3 #define DEBUG 0
4 #if DEBUG
5 #include <stdio.h>
6 #endif
7 
8 #define NMAX 2000
9 
10 static unsigned int x1[NMAX], x2[NMAX], a[NMAX][NMAX], y1[NMAX], y2[NMAX];
11 
12 static unsigned int __attribute__((noinline))
mvt(long N)13 mvt (long N)
14 {
15 
16   int i,j;
17 
18   for (i = 0; i < N; i++)
19     for (j = 0; j < N; j++)
20       x1[i] = x1[i] + a[i][j] * y1[j];
21 
22   /* These two loops should be interchanged.  */
23   for (i = 0; i < N; i++)
24     for (j = 0; j < N; j++)
25       x2[i] = x2[i] + a[j][i] * y2[j];
26 
27   return x1[0] + x2[0];
28 }
29 
30 extern void abort ();
31 
32 int
main(void)33 main (void)
34 {
35   int i, j;
36   unsigned int res;
37 
38   for (i = 0; i < NMAX; i++)
39     for (j = 0; j < NMAX; j++)
40       a[i][j] = i + j;
41 
42   for (i = 0; i < NMAX; i++)
43     {
44       x1[i] = 0;
45       x2[i] = 2*i;
46       y1[i] = 100 - i;
47       y2[i] = i;
48     }
49 
50   res = mvt (NMAX);
51 
52 #if DEBUG
53   fprintf (stderr, "res = %d \n", res);
54 #endif
55 
56   if (res != 199900000)
57     abort ();
58 
59   return 0;
60 }
61 
62 /* { dg-final { scan-tree-dump "tiled by" "graphite" } } */
63