1 /* { dg-do compile } */ 2 /* { dg-options "-O -ftree-vectorize -mavx512f" } */ 3 4 extern void abort (void); 5 6 typedef struct { 7 unsigned int a; 8 unsigned int b; 9 } ii; 10 foo(unsigned short * arr,ii * iarr)11void foo (unsigned short *arr, ii *iarr) 12 { 13 ii *iptr = iarr; 14 unsigned short res[128]; 15 ii ires[128]; 16 int i; 17 for (i = 0; i < 128; i++) 18 { 19 ires[i].a = iptr->b - iptr->a; 20 ires[i].b = iptr->b + iptr->a; 21 iptr++; 22 } 23 for (i = 0; i < 128; i++) 24 { 25 if (res[i] != arr[i] 26 || ires[i].a != iarr[i].b - iarr[i].a 27 || ires[i].b != iarr[i].b + iarr[i].a) 28 abort (); 29 } 30 } 31