OSDN Git Service

Do not FAIL in miscompiled runtime tests.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / graphite / interchange-4.c
1 /* { dg-require-effective-target size32plus } */
2
3 /* Formerly known as ltrans-4.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, int *res)
14 {
15   int i, j;
16   double sum = 0;
17   for (i = 0; i < N; i++)
18     for (j = 0; j < N; j++)
19       sum = sum + u[i + 1335 * j];
20
21   for (i = 0; i < N; i++)
22     u[1336 * i] *= 2;
23
24   *res = sum + N + u[1336 * 2] + u[1336];
25 }
26
27 int
28 main (void)
29 {
30   int i, j, res;
31
32   for (i = 0; i < 1782225; i++)
33     u[i] = 2;
34
35   foo (1335, &res);
36
37 #if DEBUG
38   fprintf (stderr, "res = %d \n", res);
39 #endif
40
41   return res != 3565793;
42 }
43
44 /* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
45 /* { dg-final { cleanup-tree-dump "graphite" } } */