summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr66174.c
blob: f591f4b03b6181b6e58d952248b43972ebaae448 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* { dg-do compile } */
/* { dg-options "-O -ftree-vectorize -mavx512f" } */

extern void abort (void);

typedef struct {
   unsigned int a;
   unsigned int b;
} ii;

void foo (unsigned short *arr, ii *iarr)
{
  ii *iptr = iarr;
  unsigned short res[128];
  ii ires[128];
  int i;
  for (i = 0; i < 128; i++)
    {
      ires[i].a = iptr->b - iptr->a;
      ires[i].b = iptr->b + iptr->a;
      iptr++;
    }
  for (i = 0; i < 128; i++)
    {
      if (res[i] != arr[i]
          || ires[i].a != iarr[i].b - iarr[i].a
          || ires[i].b != iarr[i].b + iarr[i].a)
        abort ();
    }
}