2018-05-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / uns-interchange-12.c
blob4e3c705a13a92af4a7bad6b0519a6740a9293511
1 /* { dg-require-effective-target size32plus } */
3 #define DEBUG 0
4 #if DEBUG
5 #include <stdio.h>
6 #endif
8 #define N 200
10 unsigned int A[N][N], B[N][N], C[N][N];
12 static unsigned int __attribute__((noinline))
13 matmult (void)
15 int i, j, k;
17 /* Loops J and K should be interchanged. */
18 for (i = 0; i < N; i++)
19 for (j = 0; j < N; j++)
21 A[i][j] = 0;
22 for (k = 0; k < N; k++)
23 A[i][j] += B[i][k] * C[k][j];
26 return A[0][0] + A[N-1][N-1];
29 extern void abort ();
31 int
32 main (void)
34 int i, j;
35 unsigned int res;
37 for (i = 0; i < N; i++)
38 for (j = 0; j < N; j++)
40 A[i][j] = 0;
41 B[i][j] = i - j;
42 C[i][j] = i + j;
45 res = matmult ();
47 #if DEBUG
48 fprintf (stderr, "res = %d \n", res);
49 #endif
51 if (res != 2626800)
52 abort ();
54 return 0;
57 /* { dg-final { scan-tree-dump "tiled by" "graphite" } } */