2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-section-anchors-vect-31.c
blob6060a418a3d0ac77123e85a42c01b3df08c5ccfd
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 32
8 struct t{
9 int k[N];
10 int l;
13 struct s{
14 char a; /* aligned */
15 char b[N-1]; /* unaligned (offset 1B) */
16 char c[N]; /* aligned (offset NB) */
17 struct t d; /* aligned (offset 2NB) */
18 struct t e; /* unaligned (offset 2N+4N+4 B) */
21 struct s tmp;
22 __attribute__ ((noinline))
23 int main1 ()
25 int i;
27 /* unaligned */
28 for (i = 0; i < N/2; i++)
30 tmp.b[i] = 5;
33 /* check results: */
34 for (i = 0; i <N/2; i++)
36 if (tmp.b[i] != 5)
37 abort ();
40 /* aligned */
41 for (i = 0; i < N/2; i++)
43 tmp.c[i] = 6;
46 /* check results: */
47 for (i = 0; i <N/2; i++)
49 if (tmp.c[i] != 6)
50 abort ();
53 /* aligned */
54 for (i = 0; i < N/2; i++)
56 tmp.d.k[i] = 7;
59 /* check results: */
60 for (i = 0; i <N/2; i++)
62 if (tmp.d.k[i] != 7)
63 abort ();
66 /* unaligned */
67 for (i = 0; i < N/2; i++)
69 tmp.e.k[i] = 8;
72 /* check results: */
73 for (i = 0; i <N/2; i++)
75 if (tmp.e.k[i] != 8)
76 abort ();
79 return 0;
82 int main (void)
84 check_vect ();
86 return main1 ();
89 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
90 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
91 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
92 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_hw_misalign } } } */
93 /* { dg-final { cleanup-tree-dump "vect" } } */