* gcc.dg/tree-ssa/ldist-27.c: Skip on Visium.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-interchange-2.c
bloba1305e3e400e546ea4a2ab6b046eaabcf98e1ecf
1 /* { dg-do run } */
2 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
3 /* { dg-skip-if "too big data segment" { visium-*-* } } */
5 /* Copied from graphite/interchange-5.c */
7 #define DEBUG 0
8 #if DEBUG
9 #include <stdio.h>
10 #endif
12 #define N 100
13 #define M 1111
14 int A[N][M];
16 static int __attribute__((noinline))
17 foo (void)
19 int i, j;
21 for( i = 0; i < M; i++)
22 for( j = 0; j < N; j++)
23 A[j][i] = 5 * A[j][i];
25 return A[0][0] + A[N-1][M-1];
28 extern void abort ();
30 static void __attribute__((noinline))
31 init (int i)
33 int j;
35 for (j = 0; j < M; j++)
36 A[i][j] = 2;
39 int
40 main (void)
42 int i, j, res;
44 for (i = 0; i < N; i++)
45 init (i);
47 res = foo ();
49 #if DEBUG
50 fprintf (stderr, "res = %d \n", res);
51 #endif
53 if (res != 20)
54 abort ();
56 return 0;
59 /* { dg-final { scan-tree-dump-times "Loop_pair<outer:., inner:.> is interchanged" 1 "linterchange"} } */