openmp: Fix signed/unsigned warning
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-115.c
blob9e0756e17de0840019577b7e872e52b304871784
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 16
9 struct s{
10 int b[N];
11 int c[N];
12 int m;
15 struct t{
16 struct s strc_s;
17 int m;
20 struct test1{
21 struct t strc_t;
22 struct t *ptr_t;
23 int k;
24 int l;
27 int a[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
29 __attribute__ ((noinline))
30 int main1 ()
32 int i;
33 struct test1 tmp1;
34 struct t tmp2;
36 tmp1.ptr_t = &tmp2;
38 /* DR bases comparison: record and array. */
39 for (i = 0; i < N; i++)
41 tmp1.strc_t.strc_s.b[i] = a[i];
44 /* Check results. */
45 #pragma GCC novector
46 for (i = 0; i < N; i++)
48 if (tmp1.strc_t.strc_s.b[i] != a[i])
49 abort();
52 /* DR bases comparison: record containing ptr and array. */
53 for (i = 0; i < N; i++)
55 tmp1.ptr_t->strc_s.c[i] = a[i];
58 /* Check results. */
59 #pragma GCC novector
60 for (i = 0; i < N; i++)
62 if (tmp1.ptr_t->strc_s.c[i] != a[i])
63 abort();
67 return 0;
70 int main (void)
72 check_vect ();
74 return main1 ();
77 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
80 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */