OSDN Git Service

* tree-vectorizer.h (struct _stmt_vec_info): Add new field
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-115.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 16
7
8 struct s{
9   int b[N];
10   int c[N];
11   int m;
12 };
13
14 struct t{
15   struct s strc_s;
16   int m;
17 };
18
19 struct test1{
20   struct t strc_t;
21   struct t *ptr_t;
22   int k;
23   int l;
24 };
25
26 int main1 ()
27 {
28   int i;
29   struct test1 tmp1;
30   int a[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
31   struct t tmp2;
32
33   tmp1.ptr_t = &tmp2;
34
35   /* DR bases comparison: record and array.  */
36   for (i = 0; i < N; i++)
37     {
38       tmp1.strc_t.strc_s.b[i] = a[i];
39     }
40
41   /* Check results.  */
42   for (i = 0; i < N; i++)
43     {
44       if (tmp1.strc_t.strc_s.b[i] != a[i])
45         abort();
46     }
47
48   /* DR bases comparison: record containing ptr and array.  */
49   for (i = 0; i < N; i++)
50     {
51       tmp1.ptr_t->strc_s.c[i] = a[i];
52     }
53
54   /* Check results.  */
55   for (i = 0; i < N; i++)
56     {
57       if (tmp1.ptr_t->strc_s.c[i] != a[i])
58         abort();
59     }
60
61     
62   return 0;
63 }
64        
65 int main (void)
66 {
67   check_vect ();
68     
69   return main1 ();
70 }
71           
72 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
73 /* { dg-final { cleanup-tree-dump "vect" } } */
74   
75