OSDN Git Service

PR tree-optimization/40238
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-vfa-01.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 16
7 int result[N] = {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27};
8 int X[N] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
9 int Y[N] = {};
10  
11 __attribute__ ((noinline)) void
12 foo (int *in, int *out)
13 {  
14   int i;
15   
16   for (i = 0; i < N; i++)
17     out[i] = in[i] + 2;
18 }
19
20 int
21 main (void)
22
23   int i;
24
25   check_vect ();
26
27   foo (X, Y);
28   
29   /* check results:  */
30   for (i = 0; i < N; i++)
31     {
32       if (Y[i] != result[i])
33         abort ();
34     }
35   return 0;
36
37
38 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
39 /* { dg-final { cleanup-tree-dump "vect" } } */