fix PR53852: stop ISL after a given number of operations
[platform/upstream/gcc.git] / gcc / testsuite / gcc.dg / graphite / uns-interchange-14.c
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 unsigned int A[N][N], B[N][N], C[N][N];
11
12 static void __attribute__((noinline))
13 matmult (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
31 main (void)
32 {
33   int i, j;
34   unsigned res = 0;
35
36   for (i = 0; i < N; i++)
37     for (j = 0; j < N; j++)
38       {
39         B[i][j] = j;
40         C[i][j] = i;
41       }
42
43   matmult ();
44
45   for (i = 0; i < N; i++)
46     res += A[i][i];
47
48 #if DEBUG
49   fprintf (stderr, "res = %d \n", res);
50 #endif
51
52   if (res != 529340000)
53     abort ();
54
55   return 0;
56 }
57
58 /* { dg-final { scan-tree-dump "tiled by" "graphite" } } */