[gcc/]
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / interchange-6.c
blob9e189050e6f791ba0910e8e16d5571770db78d6d
1 /* { dg-require-effective-target size32plus } */
3 /* Formerly known as ltrans-6.c */
5 #define DEBUG 0
6 #if DEBUG
7 #include <stdio.h>
8 #endif
10 #define N 100
11 #define M 200
13 static int __attribute__((noinline))
14 foo (int A[N][M])
16 int i, j;
18 /* This loop should be interchanged. */
19 for(j = 0; j < M; j++)
20 for(i = 0; i < N; i++)
21 A[i][j] = A[i][j] + A[i][j];
23 return A[0][0] + A[N-1][M-1];
26 extern void abort ();
28 int
29 main (void)
31 int A[N][M];
32 int i, j, res;
34 for (i = 0; i < N; i++)
35 for (j = 0; j < M; j++)
36 A[i][j] = 2;
38 res = foo (A);
40 #if DEBUG
41 fprintf (stderr, "res = %d \n", res);
42 #endif
44 if (res != 8)
45 abort ();
47 return 0;
50 /* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
51 /* { dg-final { cleanup-tree-dump "graphite" } } */