Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-68.c
blobc4f8857ba8adbc6325ac525fb24b8e3a08a4b3e1
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 32
8 struct s{
9 int m;
10 int n[N][N][N];
13 struct test1{
14 struct s a; /* array a.n is unaligned */
15 int b;
16 int c;
17 struct s e; /* array e.n is aligned */
20 __attribute__ ((noinline))
21 int main1 ()
23 int i,j;
24 struct test1 tmp1;
26 /* 1. unaligned */
27 for (i = 0; i < N; i++)
29 tmp1.a.n[1][2][i] = 5;
32 /* check results: */
33 for (i = 0; i <N; i++)
35 if (tmp1.a.n[1][2][i] != 5)
36 abort ();
39 /* 2. aligned */
40 for (i = 3; i < N-1; i++)
42 tmp1.a.n[1][2][i] = 6;
45 /* check results: */
46 for (i = 3; i < N-1; i++)
48 if (tmp1.a.n[1][2][i] != 6)
49 abort ();
52 /* 3. aligned */
53 for (i = 0; i < N; i++)
55 tmp1.e.n[1][2][i] = 7;
58 /* check results: */
59 for (i = 0; i < N; i++)
61 if (tmp1.e.n[1][2][i] != 7)
62 abort ();
65 /* 4. unaligned */
66 for (i = 3; i < N-3; i++)
68 tmp1.e.n[1][2][i] = 8;
71 /* check results: */
72 for (i = 3; i <N-3; i++)
74 if (tmp1.e.n[1][2][i] != 8)
75 abort ();
78 return 0;
81 int main (void)
83 check_vect ();
85 return main1 ();
88 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
89 /* { dg-final { cleanup-tree-dump "vect" } } */