OSDN Git Service

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