Imported Upstream version 4.7.3
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.dg / vect / vect-34-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 struct {
9   char ca[N];
10 } s;
11 char cb[N];
12
13 volatile int y = 0;
14
15 __attribute__ ((noinline))
16 int main1 ()
17 {
18   int i;
19
20   for (i = 0; i < N; i++)
21     {
22       cb[i] = i*3;
23       /* To avoid vectorization.  */
24       if (y)
25         abort ();
26     }
27   for (i = 0; i < N; i++)
28     {
29       s.ca[i] = cb[i];
30     }
31
32   /* check results:  */
33   for (i = 0; i < N; i++)
34     {
35       if (s.ca[i] != cb[i])
36         abort ();
37     }
38
39   return 0;
40 }
41
42 int main (void)
43 {
44   check_vect ();
45
46   return main1 ();
47 }
48
49 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
50 /* { dg-final { cleanup-tree-dump "vect" } } */