Merged with mainline at revision 128810.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-115.c
blobed1d6794fb1f42f719dab3c3dbe3a5428356c9e9
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 struct s{
9 int b[N];
10 int c[N];
11 int m;
14 struct t{
15 struct s strc_s;
16 int m;
19 struct test1{
20 struct t strc_t;
21 struct t *ptr_t;
22 int k;
23 int l;
26 __attribute__ ((noinline))
27 int main1 ()
29 int i;
30 struct test1 tmp1;
31 int a[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
32 struct t tmp2;
34 tmp1.ptr_t = &tmp2;
36 /* DR bases comparison: record and array. */
37 for (i = 0; i < N; i++)
39 tmp1.strc_t.strc_s.b[i] = a[i];
42 /* Check results. */
43 for (i = 0; i < N; i++)
45 if (tmp1.strc_t.strc_s.b[i] != a[i])
46 abort();
49 /* DR bases comparison: record containing ptr and array. */
50 for (i = 0; i < N; i++)
52 tmp1.ptr_t->strc_s.c[i] = a[i];
55 /* Check results. */
56 for (i = 0; i < N; i++)
58 if (tmp1.ptr_t->strc_s.c[i] != a[i])
59 abort();
63 return 0;
66 int main (void)
68 check_vect ();
70 return main1 ();
73 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
74 /* { dg-final { cleanup-tree-dump "vect" } } */