Merged revision 156805 into branch.
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / interchange-1.c
blob787124f56a4f11f4caebd3da8ffd590f17704697
1 /* { dg-require-effective-target size32plus } */
3 /* Formerly known as ltrans-1.c */
5 #define DEBUG 0
6 #if DEBUG
7 #include <stdio.h>
8 #endif
10 double u[1782225];
12 static int __attribute__((noinline))
13 foo (int N)
15 int i, j;
16 double sum = 0.0;
18 for (i = 0; i < N; i++)
20 for (j = 0; j < N; j++)
21 sum = sum + u[i + 1335 * j];
23 u[1336 * i] *= 2;
26 return sum + N + u[1336 * 2] + u[1336];
29 extern void abort ();
31 int
32 main (void)
34 int i, j, res;
36 for (i = 0; i < 1782225; i++)
37 u[i] = 2;
39 res = foo (1335);
41 #if DEBUG
42 fprintf (stderr, "res = %d \n", res);
43 #endif
45 if (res != 3565793)
46 abort ();
48 return 0;
52 /* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
53 /* { dg-final { cleanup-tree-dump "graphite" } } */