Imported Upstream version 4.7.3
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.dg / vect / vect-33.c
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
3
4 #include <stdarg.h>
5 #include "tree-vect.h"
6
7 #define N 16
8 struct test {
9   char ca[N];
10 };
11
12 extern struct test s;
13  
14 __attribute__ ((noinline))
15 int main1 ()
16 {  
17   int i;
18
19   for (i = 0; i < N; i++)
20     {
21       s.ca[i] = 5;
22     }
23
24   /* check results:  */
25   for (i = 0; i < N; i++)
26     {
27       if (s.ca[i] != 5)
28         abort ();
29     }
30
31   return 0;
32 }
33
34 int main (void)
35
36   return main1 ();
37
38
39
40 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  } } */
41 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
42 /* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" { target vector_alignment_reachable } } } */
43 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
44 /* { dg-final { cleanup-tree-dump "vect" } } */