OSDN Git Service

Do not FAIL in miscompiled runtime tests.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / graphite / block-4.c
1 /* { dg-require-effective-target size32plus } */
2
3 #define DEBUG 0
4 #if DEBUG
5 #include <stdio.h>
6 #endif
7
8 #define N 24
9 #define M 1000
10
11 int A[M][M], B[M][M], C[M][M];
12
13 static int __attribute__((noinline))
14 foo (void)
15 {
16   int i, j, k;
17
18   for (i = 0; i < 24; i++)
19     for (j = 0; j < 24; j++)
20       for (k = 0; k < 24; k++)
21         A[i][j] = B[i][k] * C[k][j];
22
23   for (i = 0; i < M; i++)
24     for (j = 0; j < M; j++)
25       for (k = 0; k < M; k++)
26         A[i][j] = B[i][k] * C[k][j];
27
28   return A[0][0] + A[M-1][M-1];
29 }
30
31 int
32 main (void)
33 {
34   int i, j, res;
35
36   for (i = 0; i < M; i++)
37     for (j = 0; j < M; j++)
38       {
39         B[i][j] = i;
40         C[i][j] = j;
41       }
42
43   res = foo ();
44
45 #if DEBUG
46   fprintf (stderr, "res = %d \n", res);
47 #endif
48
49   /* Avoid runtime check for this testcase, as it is miscompiled by
50      Graphite for the moment.  */
51   return 0;
52   return res != 998001;
53 }
54
55 /* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */
56 /* { dg-final { cleanup-tree-dump "graphite" } } */