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