Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.dg / vect / vect-68.c
blob05ab1ddc94b0b2c9b45bf88e8cd8df3cc87b694d
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 int main1 ()
22 int i,j;
23 struct test1 tmp1;
25 /* 1. unaligned */
26 for (i = 0; i < N; i++)
28 tmp1.a.n[1][2][i] = 5;
31 /* check results: */
32 for (i = 0; i <N; i++)
34 if (tmp1.a.n[1][2][i] != 5)
35 abort ();
38 /* 2. aligned */
39 for (i = 3; i < N-1; i++)
41 tmp1.a.n[1][2][i] = 6;
44 /* check results: */
45 for (i = 3; i < N-1; i++)
47 if (tmp1.a.n[1][2][i] != 6)
48 abort ();
51 /* 3. aligned */
52 for (i = 0; i < N; i++)
54 tmp1.e.n[1][2][i] = 7;
57 /* check results: */
58 for (i = 0; i < N; i++)
60 if (tmp1.e.n[1][2][i] != 7)
61 abort ();
64 /* 4. unaligned */
65 for (i = 3; i < N-3; i++)
67 tmp1.e.n[1][2][i] = 8;
70 /* check results: */
71 for (i = 3; i <N-3; i++)
73 if (tmp1.e.n[1][2][i] != 8)
74 abort ();
77 return 0;
80 int main (void)
82 check_vect ();
84 return main1 ();
87 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
88 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
89 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
90 /* { dg-final { cleanup-tree-dump "vect" } } */