PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-interchange-12.c
blobaffb3680ea09a0f25bad9f765035969425b76866
1 /* { dg-do run } */
2 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
4 /* Copied from graphite/interchange-4.c */
6 #define DEBUG 0
7 #if DEBUG
8 #include <stdio.h>
9 #endif
11 unsigned u[1024];
13 static void __attribute__((noinline,noclone,noipa))
14 foo (int N, unsigned *res)
16 int i, j;
17 unsigned sum = 1;
18 for (i = 0; i < N; i++)
19 for (j = 0; j < N; j++)
20 sum = u[i + 2 * j] / sum;
22 *res = sum;
25 extern void abort ();
27 int
28 main (void)
30 int i, j;
31 unsigned res;
33 u[0] = 10;
34 u[1] = 200;
35 u[2] = 10;
36 u[3] = 10;
38 foo (2, &res);
40 #if DEBUG
41 fprintf (stderr, "res = %d \n", res);
42 #endif
44 if (res != 0)
45 abort ();
47 return 0;
50 /* { dg-final { scan-tree-dump-not "is interchanged" "linterchange"} } */