Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / vect / no-section-anchors-vect-68.c
blobde036e88ebf04f394d26092b18a7fe93fde3b27d
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 struct test1 tmp1;
22 __attribute__ ((noinline))
23 int main1 ()
25 int i,j;
27 /* 1. unaligned */
28 for (i = 0; i < N; i++)
30 tmp1.a.n[1][2][i] = 5;
33 /* check results: */
34 for (i = 0; i <N; i++)
36 if (tmp1.a.n[1][2][i] != 5)
37 abort ();
40 /* 2. aligned */
41 for (i = 3; i < N-1; i++)
43 tmp1.a.n[1][2][i] = 6;
46 /* check results: */
47 for (i = 3; i < N-1; i++)
49 if (tmp1.a.n[1][2][i] != 6)
50 abort ();
53 /* 3. aligned */
54 for (i = 0; i < N; i++)
56 tmp1.e.n[1][2][i] = 7;
59 /* check results: */
60 for (i = 0; i < N; i++)
62 if (tmp1.e.n[1][2][i] != 7)
63 abort ();
66 /* 4. unaligned */
67 for (i = 3; i < N-3; i++)
69 tmp1.e.n[1][2][i] = 8;
72 /* check results: */
73 for (i = 3; i <N-3; i++)
75 if (tmp1.e.n[1][2][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" } } */
91 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
92 /* { dg-final { cleanup-tree-dump "vect" } } */