Remove the temporary array for reductions written to memory.
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / graphite / block-1.c
blobd335345a6990b53fa3a354d535f71953edddfddc
1 /* { dg-require-effective-target size32plus } */
3 #define DEBUG 0
4 #if DEBUG
5 #include <stdio.h>
6 #endif
8 #define MAX 100
10 extern void abort ();
12 int
13 main (void)
15 int i, j;
16 int sum = 0;
17 int A[MAX * MAX];
18 int B[MAX * MAX];
20 /* These loops should be loop blocked. */
21 for (i = 0; i < MAX; i++)
22 for (j = 0; j < MAX; j++)
24 A[i*MAX + j] = j;
25 B[i*MAX + j] = j;
28 /* These loops should be loop blocked. */
29 for (i = 0; i < MAX; i++)
30 for (j = 0; j < MAX; j++)
31 A[i*MAX + j] += B[j*MAX + i];
33 /* These loops should be loop blocked. */
34 for(i = 0; i < MAX; i++)
35 for(j = 0; j < MAX; j++)
36 sum += A[i*MAX + j];
38 #if DEBUG
39 fprintf (stderr, "sum = %d \n", sum);
40 #endif
42 if (sum != 990000)
43 abort ();
45 return 0;
48 /* { dg-final { scan-tree-dump-times "will be loop blocked" 3 "graphite" } } */
49 /* { dg-final { cleanup-tree-dump "graphite" } } */