Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / vect / vect-peel-1.c
blob6af81a6f99311dec79944eb83e6fb6e3a5cb584c
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-add-options quad_vectors } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 128
9 int ib[N+7];
11 __attribute__ ((noinline))
12 int main1 ()
14 int i;
15 int ia[N+1];
17 /* All the accesses are misaligned. With cost model disabled, we count the
18 the number of aligned accesses for each peeling option, and in this case
19 we align the two loads if possible (i.e., if misaligned stores are
20 supported). */
21 for (i = 1; i <= N; i++)
23 ia[i] = ib[i+2] + ib[i+6];
26 /* check results: */
27 for (i = 1; i <= N; i++)
29 if (ia[i] != ib[i+2] + ib[i+6])
30 abort ();
33 return 0;
36 int main (void)
38 int i;
40 check_vect ();
42 for (i = 0; i <= N+6; i++)
43 ib[i] = i;
45 return main1 ();
48 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail vect_no_align } } } */
49 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_element_align } } } */
50 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */
51 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_no_align } } } */
52 /* { dg-final { cleanup-tree-dump "vect" } } */