Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-interchange-15.c
blobfca70d697130c4b7de36920c57b7dd34bf30edba
1 /* PR tree-optimization/83337 */
2 /* { dg-do run { target int32plus } } */
3 /* { dg-options "-O2 -floop-interchange" } */
4 /* { dg-require-effective-target alloca } */
5 /* { dg-skip-if "too big stack" { visium-*-* } } */
7 /* Copied from graphite/interchange-5.c */
9 #define DEBUG 0
10 #if DEBUG
11 #include <stdio.h>
12 #endif
14 #define N 100
15 #define M 1111
17 extern void abort ();
19 static void __attribute__((noipa))
20 foo (int n)
22 int i, j;
23 struct S { char d[n]; int a : 3; int b : 17; int c : 12; };
24 struct S A[N][M];
26 for (i = 0; i < N; i++)
28 asm volatile ("" : : "g" (&A[0][0]) : "memory");
29 for (j = 0; j < M; j++)
30 A[i][j].b = 2;
32 asm volatile ("" : : "g" (&A[0][0]) : "memory");
34 for (i = 0; i < M; i++)
35 for (j = 0; j < N; j++)
36 A[j][i].b = 5 * A[j][i].b;
38 asm volatile ("" : : "g" (&A[0][0]) : "memory");
39 int res = A[0][0].b + A[N-1][M-1].b;
41 #if DEBUG
42 fprintf (stderr, "res = %d \n", res);
43 #endif
45 if (res != 20)
46 abort ();
49 int
50 main (void)
52 foo (1);
53 foo (8);
54 return 0;