Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / graphite / interchange-9.c
blob3f8e843ea3be0f594e06783d3880289c140f66e2
1 /* { dg-require-effective-target size32plus } */
3 #define DEBUG 0
4 #if DEBUG
5 #include <stdio.h>
6 #endif
8 #define N 111
9 #define M 111
11 static int __attribute__((noinline))
12 foo (int *x)
14 int i, j;
15 int sum = 0;
17 for (j = 0; j < M; ++j)
18 for (i = 0; i < N; ++i)
19 sum += x[M * i + j];
21 return sum;
24 extern void abort ();
26 int
27 main (void)
29 int A[N*M];
30 int i, res;
32 for (i = 0; i < N*M; i++)
33 A[i] = 2;
35 res = foo (A);
37 #if DEBUG
38 fprintf (stderr, "res = %d \n", res);
39 #endif
41 if (res != 24642)
42 abort ();
44 return 0;
47 /* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
48 /* { dg-final { cleanup-tree-dump "graphite" } } */