Imported Upstream version 4.7.3
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.dg / vect / vect-2-big-array.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 128
7
8 char cb[N];
9 char ca[N];
10
11 volatile int y = 0;
12
13 __attribute__ ((noinline))
14 int main1 ()
15 {
16   int i;
17
18   for (i = 0; i < N; i++)
19     {
20       cb[i] = i*3;
21       /* To avoid vectorization.  */
22       if (y)
23         abort ();
24     }
25
26   for (i = 0; i < N; i++)
27     {
28       ca[i] = cb[i];
29     }
30
31   /* check results:  */
32   for (i = 0; i < N; i++)
33     {
34       if (ca[i] != cb[i])
35         abort ();
36     }
37
38   return 0;
39 }
40
41 int main (void)
42 {
43   check_vect ();
44
45   return main1 ();
46 }
47
48 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
49 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
50 /* { dg-final { cleanup-tree-dump "vect" } } */