OSDN Git Service

* tree-vectorizer.h (struct _stmt_vec_info): Add new field
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-30.c
1 /* { dg-require-effective-target vect_float } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 16
7
8 float b[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
9 float a[N];
10 float c[N];
11
12 int main1 (int n)
13 {
14   int i=0;
15
16   /* Vectorized: unknown loop bound.  */
17   while (n--) {
18     a[i] = b[i];
19     i++;
20   }
21
22   /* check results:  */
23   for (i = 0; i < n; i++)
24     {
25       if (a[i] != b[i])
26         abort ();
27     }
28
29   return 0;
30 }
31
32 int main2 (unsigned int n)
33 {
34   int i=0;
35   int nn = n;
36
37   /* Vectorized: unknown loop bound.  */
38   while (n--) {
39     c[i] = b[i];
40     i++;
41   }
42
43   /* check results:  */
44   for (i = 0; i < nn; i++)
45     {
46       if (c[i] != b[i])
47         abort ();
48     }
49
50   return 0;
51 }
52
53 int main (void)
54
55   check_vect ();
56   
57   main1 (N);
58   main2 (N);
59   return 0;
60 }
61
62 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
63 /* { dg-final { cleanup-tree-dump "vect" } } */