PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-72.c
blob472d8d57549cf73c2357c81ed1e8ac018e179c01
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 load. */
11 char ia[N];
12 char ib[N+1];
14 __attribute__ ((noinline))
15 int main1 ()
17 int i;
19 for (i=0; i < N+1; i++)
21 ib[i] = i;
22 if (i%3 == 0)
23 ib[i] = 5;
24 /* Avoid vectorization. */
25 __asm__ volatile ("" : : : "memory");
28 for (i = 1; i < N+1; i++)
30 ia[i-1] = ib[i];
33 /* check results: */
34 for (i = 1; i <= N; i++)
36 if (ia[i-1] != ib[i])
37 abort ();
40 return 0;
43 int main (void)
45 check_vect ();
47 return main1 ();
50 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
51 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */
52 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */