Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / vect / vect-115.c
blobce6eaf4548829d2106e3f54a3fd105cff961bbd3
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 int a[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
28 __attribute__ ((noinline))
29 int main1 ()
31 int i;
32 struct test1 tmp1;
33 struct t tmp2;
35 tmp1.ptr_t = &tmp2;
37 /* DR bases comparison: record and array. */
38 for (i = 0; i < N; i++)
40 tmp1.strc_t.strc_s.b[i] = a[i];
43 /* Check results. */
44 for (i = 0; i < N; i++)
46 if (tmp1.strc_t.strc_s.b[i] != a[i])
47 abort();
50 /* DR bases comparison: record containing ptr and array. */
51 for (i = 0; i < N; i++)
53 tmp1.ptr_t->strc_s.c[i] = a[i];
56 /* Check results. */
57 for (i = 0; i < N; i++)
59 if (tmp1.ptr_t->strc_s.c[i] != a[i])
60 abort();
64 return 0;
67 int main (void)
69 check_vect ();
71 return main1 ();
74 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
75 /* { dg-final { cleanup-tree-dump "vect" } } */