1 /* { dg-require-effective-target size32plus } */ 2 3 #define DEBUG 0 4 #if DEBUG 5 #include <stdio.h> 6 #endif 7 8 #define N 200 9 10 int A[N][N], B[N][N], C[N][N]; 11 12 static void __attribute__((noinline)) matmult(void)13matmult (void) 14 { 15 int i, j, k; 16 17 for (i = 0; i < N; i++) 18 for (j = 0; j < N; j++) 19 A[i][j] = 0; 20 21 /* Loops J and K should be interchanged. */ 22 for (i = 0; i < N; i++) 23 for (j = 0; j < N; j++) 24 for (k = 0; k < N; k++) 25 A[i][j] += B[i][k] * C[k][j]; 26 } 27 28 extern void abort (); 29 30 int main(void)31main (void) 32 { 33 int i, j, res = 0; 34 35 for (i = 0; i < N; i++) 36 for (j = 0; j < N; j++) 37 { 38 B[i][j] = j; 39 C[i][j] = i; 40 } 41 42 matmult (); 43 44 for (i = 0; i < N; i++) 45 res += A[i][i]; 46 47 #if DEBUG 48 fprintf (stderr, "res = %d \n", res); 49 #endif 50 51 if (res != 529340000) 52 abort (); 53 54 return 0; 55 } 56 57 /* { dg-final { scan-tree-dump "tiled by" "graphite" } } */ 58