PR middle-end/27945
[official-gcc.git] / gcc / testsuite / gcc.dg / pr29581-4.c
blobc2d894c8d201f4b23c5412ce9fc854759f931b08
1 /* PR tree-optimization/29581 */
2 /* Origin: gcc.dg/vect/vect-88.c */
3 /* { dg-do run } */
4 /* { dg-options "-O2 -ftree-loop-linear" } */
6 extern void abort (void);
8 #define N 16
10 int main1 (int n, int *a)
12 int i, j, k;
13 int b[N];
15 for (i = 0; i < n; i++)
17 for (j = 0; j < n; j++)
19 k = i + n;
20 a[j] = k;
22 b[i] = k;
26 for (j = 0; j < n; j++)
27 if (a[j] != i + n - 1)
28 abort();
30 for (j = 0; j < n; j++)
31 if (b[j] != j + n)
32 abort();
34 return 0;
37 int main (void)
39 int a[N+1] __attribute__ ((__aligned__(16)));
41 main1 (N, a+1);
42 main1 (0, a+1);
43 main1 (1, a+1);
44 main1 (2, a+1);
45 main1 (N-1, a+1);
47 return 0;