Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-interchange-1.c
blob4a81e128e160a1a0bdac561ca2c6309ed574f6b6
1 /* { dg-do run } */
2 /* { dg-options "-O2 -floop-interchange -fassociative-math -fno-signed-zeros -fno-trapping-math -fdump-tree-linterchange-details" } */
3 /* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
5 /* Copied from graphite/interchange-4.c */
7 #define DEBUG 0
8 #if DEBUG
9 #include <stdio.h>
10 #endif
12 double u[1782225];
14 static int __attribute__((noinline))
15 foo (int N, int *res)
17 int i, j;
18 double sum = 0;
19 for (i = 0; i < N; i++)
20 for (j = 0; j < N; j++)
21 sum = sum + u[i + 1335 * j];
23 for (i = 0; i < N; i++)
24 u[1336 * i] *= 2;
26 *res = 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 foo (1335, &res);
41 #if DEBUG
42 fprintf (stderr, "res = %d \n", res);
43 #endif
45 if (res != 3565793)
46 abort ();
48 return 0;
51 /* { dg-final { scan-tree-dump-times "Loop_pair<outer:., inner:.> is interchanged" 1 "linterchange"} } */