1 /* { dg-do run } */
2 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
3 
4 /* Copied from graphite/interchange-4.c */
5 
6 #define DEBUG 0
7 #if DEBUG
8 #include <stdio.h>
9 #endif
10 
11 unsigned u[1024];
12 
13 static void __attribute__((noinline,noclone,noipa))
foo(int N,unsigned * res)14 foo (int N, unsigned *res)
15 {
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;
21 
22   *res = sum;
23 }
24 
25 extern void abort ();
26 
27 int
main(void)28 main (void)
29 {
30   int i, j;
31   unsigned res;
32 
33   u[0] = 10;
34   u[1] = 200;
35   u[2] = 10;
36   u[3] = 10;
37 
38   foo (2, &res);
39 
40 #if DEBUG
41   fprintf (stderr, "res = %d \n", res);
42 #endif
43 
44   if (res != 0)
45     abort ();
46 
47   return 0;
48 }
49 
50 /* { dg-final { scan-tree-dump-not "is interchanged" "linterchange"} } */
51