OSDN Git Service

PR testsuite/21010
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-78.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 8
7 #define OFF 8
8
9 typedef int aint __attribute__ ((__aligned__(16)));
10
11 aint ib[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
12 int off = 8;
13
14 int main1 (aint *ib)
15 {
16   int i;
17   int ia[N];
18
19   for (i = 0; i < N; i++)
20     {
21       ia[i] = ib[i+off];
22     }
23
24
25   /* check results:  */
26   for (i = 0; i < N; i++)
27     {
28      if (ia[i] != ib[i+off])
29         abort ();
30     }
31
32   return 0;
33 }
34
35 int main (void)
36 {
37   check_vect ();
38
39   main1 (ib);
40   return 0;
41 }
42
43 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { lp64 || vect_no_align } } } } */
44 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { lp64 || vect_no_align } } } } */
45 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
46 /* { dg-final { cleanup-tree-dump "vect" } } */