PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-25.c
blobff7eff202cb64ab5a4e6ff8feb71d7b1e1890bb3
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-add-options bind_pic_locally } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 128
9 /* Unaligned stores. */
11 int ia[N+2];
12 short sa[N+2];
14 int main1 (int n)
16 int i;
18 for (i = 1; i <= N/2; i++)
20 ia[2*i] = 25;
21 ia[2*i + 1] = 5;
24 /* check results: */
25 for (i = 1; i <= N/2; i++)
27 if (ia[2*i] != 25
28 || ia[2*i + 1] != 5)
29 abort ();
32 for (i = 1; i <= n/2; i++)
34 sa[2*i] = 25;
35 sa[2*i + 1] = 5;
38 /* check results: */
39 for (i = 1; i <= n/2; i++)
41 if (sa[2*i] != 25
42 || sa[2*i + 1] != 5)
43 abort ();
47 return 0;
50 int main (void)
53 check_vect ();
55 return main1 (N);
58 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
59 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
60 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { { ! vect_unaligned_possible } || { ! vect_natural_alignment } } } } } */