Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-interchange-14.c
blob64c761ca55a3bdb6ccf9227e0208afdcd19ef2b3
1 /* PR tree-optimization/83337 */
2 /* { dg-do run { target int32plus } } */
3 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
4 /* { dg-skip-if "too big data segment" { visium-*-* } } */
6 /* Copied from graphite/interchange-5.c */
8 #define DEBUG 0
9 #if DEBUG
10 #include <stdio.h>
11 #endif
13 #define N 100
14 #define M 1111
15 struct S { int a : 3; int b : 17; int c : 12; };
16 struct S A[N][M];
18 static int __attribute__((noinline))
19 foo (void)
21 int i, j;
23 for( i = 0; i < M; i++)
24 for( j = 0; j < N; j++)
25 A[j][i].b = 5 * A[j][i].b;
27 return A[0][0].b + A[N-1][M-1].b;
30 extern void abort ();
32 static void __attribute__((noinline))
33 init (int i)
35 int j;
37 for (j = 0; j < M; j++)
38 A[i][j].b = 2;
41 int
42 main (void)
44 int i, j, res;
46 for (i = 0; i < N; i++)
47 init (i);
49 res = foo ();
51 #if DEBUG
52 fprintf (stderr, "res = %d \n", res);
53 #endif
55 if (res != 20)
56 abort ();
58 return 0;
61 /* { dg-final { scan-tree-dump-times "Loop_pair<outer:., inner:.> is interchanged" 1 "linterchange"} } */