Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-interchange-8.c
blob5ed300aa165b6ef8fc90bb6b5af3a2fe33b47329
1 /* { dg-do run } */
2 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
3 /* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
5 #define M 256
6 int a[M][M], b[M][M], c[M][M], d[M][M];
7 void __attribute__((noinline))
8 matrix_mul_1 (int n)
10 for (int i = 0; i < n; i++)
11 for (int k = 0; k < n; k++)
12 for (int j = 0; j < n; j++)
13 c[i][j] = c[i][j] + a[i][k]*b[k][j];
16 void __attribute__((noinline))
17 matrix_mul_2 (int n)
19 for (int i = 0; i < n; i++)
21 for (int j = 0; j < n; j++)
23 for (int k = 0; k < n; k++)
24 d[i][j] = d[i][j] + a[i][k]*b[k][j];
26 asm volatile ("" ::: "memory");
28 asm volatile ("" ::: "memory");
32 extern void abort ();
34 static void __attribute__((noinline))
35 init (int i)
37 for (int j = 0; j < M; j++)
39 a[i][j] = i;
40 b[i][j] = j;
41 c[i][j] = 0;
42 d[i][j] = 0;
46 static int __attribute__((noinline))
47 check (int i)
49 for (int j = 0; j < M; j++)
50 if (c[i][j] != d[i][j])
51 return 0;
53 return 1;
56 int main (void)
58 for (int i = 0; i < M; ++i)
59 init (i);
61 matrix_mul_1 (M);
62 matrix_mul_2 (M);
64 for (int i = 0; i < M; ++i)
65 if (!check (i))
66 abort ();
68 return 0;
71 /* { dg-final { scan-tree-dump-not "Loop_pair<outer:., inner:.> is interchanged" "linterchange" } } */