Add runtime tests for interchange and blocking.
[official-gcc/constexpr.git] / gcc / testsuite / gcc.dg / graphite / interchange-mvt.c
blob1e44f0a0dbd24af8e87e756e987844fb7a3f10c8
1 /* { dg-require-effective-target size32plus } */
3 #define DEBUG 0
4 #if DEBUG
5 #include <stdio.h>
6 #endif
8 #define NMAX 2000
10 static int x1[NMAX], x2[NMAX], a[NMAX][NMAX], y1[NMAX], y2[NMAX];
12 static int __attribute__((noinline))
13 mvt (long N)
16 int i,j;
18 for (i = 0; i < N; i++)
19 for (j = 0; j < N; j++)
20 x1[i] = x1[i] + a[i][j] * y1[j];
22 for (i = 0; i < N; i++)
23 for (j = 0; j < N; j++)
24 x2[i] = x2[i] + a[j][i] * y2[j];
26 return x1[0] + x2[0];
29 int
30 main (void)
32 int i, j, res;
34 for (i = 0; i < NMAX; i++)
35 for (j = 0; j < NMAX; j++)
36 a[i][j] = i + j;
38 for (i = 0; i < NMAX; i++)
40 x1[i] = 0;
41 x2[i] = 2*i;
42 y1[i] = 100 - i;
43 y2[i] = i;
46 res = mvt (NMAX);
48 #if DEBUG
49 fprintf (stderr, "res = %d \n", res);
50 #endif
52 return res != 199900000;
55 /* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
56 /* { dg-final { cleanup-tree-dump "graphite" } } */