PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr40074.c
blob143ee05b1fda4b0f858e31cad2ecd4211530e7b6
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 typedef struct {
9 int a;
10 int b;
11 int c;
12 int d;
13 } s;
16 s arr[N] = {{7,0,1,5}, {7,2,3,5}, {7,4,5,5}, {7,6,7,5}, {7,8,9,5}, {7,10,11,5}, {7,12,13,5}, {7,14,15,5}, {7,16,17,5}, {7,18,19,5}, {7,20,21,5}, {7,22,23,5}, {7,24,25,5}, {7,26,27,5}, {7,28,29,5}, {7,30,31,5}};
18 __attribute__ ((noinline)) int
19 main1 ()
21 s *p = arr, *q = arr + 1;
22 int res[N];
23 int i;
25 for (i = 0; i < N-1; i++)
27 res[i] = p->b + p->d + q->b;
28 p++;
29 q++;
32 /* check results: */
33 for (i = 0; i < N-1; i++)
35 if (res[i] != arr[i].b + arr[i].d + arr[i+1].b)
36 abort ();
39 return 0;
42 int main (void)
44 int i;
46 check_vect ();
48 main1 ();
50 return 0;