1 /* { dg-require-effective-target vect_int } */
2 /* { dg-add-options bind_pic_locally } */
3
4 #include <stdarg.h>
5 #include "tree-vect.h"
6
7 #define N 128
8
9 /* unaligned load. */
10
11 char ia[N];
12 char ib[N+1];
13
14 __attribute__ ((noinline))
main1()15 int main1 ()
16 {
17 int i;
18
19 for (i=0; i < N+1; i++)
20 {
21 ib[i] = i;
22 if (i%3 == 0)
23 ib[i] = 5;
24 /* Avoid vectorization. */
25 __asm__ volatile ("" : : : "memory");
26 }
27
28 for (i = 1; i < N+1; i++)
29 {
30 ia[i-1] = ib[i];
31 }
32
33 /* check results: */
34 for (i = 1; i <= N; i++)
35 {
36 if (ia[i-1] != ib[i])
37 abort ();
38 }
39
40 return 0;
41 }
42
main(void)43 int main (void)
44 {
45 check_vect ();
46
47 return main1 ();
48 }
49
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" } } */
53