OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / graphite / interchange-1.c
1 /* { dg-require-effective-target size32plus } */
2
3 /* Formerly known as ltrans-1.c */
4
5 #define DEBUG 0
6 #if DEBUG
7 #include <stdio.h>
8 #endif
9
10 double u[1782225];
11
12 static int __attribute__((noinline))
13 foo (int N)
14 {
15   int i, j;
16   double sum = 0.0;
17
18   for (i = 0; i < N; i++)
19     {
20       for (j = 0; j < N; j++)
21         sum = sum + u[i + 1335 * j];
22
23       u[1336 * i] *= 2;
24     }
25
26   return sum + N + u[1336 * 2] + u[1336];
27 }
28
29 extern void abort ();
30
31 int
32 main (void)
33 {
34   int i, j, res;
35
36   for (i = 0; i < 1782225; i++)
37     u[i] = 2;
38
39   res = foo (1335);
40
41 #if DEBUG
42   fprintf (stderr, "res = %d \n", res);
43 #endif
44
45   if (res != 3565793)
46     abort ();
47
48   return 0;
49 }
50
51
52 /* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
53 /* { dg-final { cleanup-tree-dump "graphite" } } */