2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-70.c
blobbf206874ecde3b1e5cb3deecf23390fe13772f71
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 24
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[N]; /* array e.n is aligned */
20 __attribute__ ((noinline))
21 int main1 ()
23 int i,j;
24 struct test1 tmp1;
26 for (i = 0; i < N; i++)
27 for (j = 3; j < N-3; j++)
29 tmp1.e[i].n[1][2][j] = 8;
32 /* check results: */
33 for (i = 0; i < N; i++)
34 for (j = 3; j < N-3; j++)
36 if (tmp1.e[i].n[1][2][j] != 8)
37 abort ();
40 /* not consecutive */
41 for (i = 0; i < N; i++)
42 for (j = 3; j < N-3; j++)
44 tmp1.e[j].n[1][2][j] = 8;
47 /* check results: */
48 for (i = 0; i < N; i++)
49 for (j = 3; j < N-3; j++)
51 if (tmp1.e[j].n[1][2][j] != 8)
52 abort ();
55 return 0;
58 int main (void)
60 check_vect ();
62 return main1 ();
65 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
66 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
67 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
68 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable && { ! {vect_hw_misalign} } } } } } */
69 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target {{! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
70 /* { dg-final { cleanup-tree-dump "vect" } } */