From fd02576de9998e0207d1477903ab3a8c4de3f88f Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Sun, 17 May 2015 23:45:40 +0200 Subject: [PATCH] pr66174.c: New test. * gcc.target/i386/pr66174.c: New test. From-SVN: r223275 --- gcc/testsuite/gcc.target/i386/pr66174.c | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr66174.c diff --git a/gcc/testsuite/gcc.target/i386/pr66174.c b/gcc/testsuite/gcc.target/i386/pr66174.c new file mode 100644 index 00000000000..f591f4b03b6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr66174.c @@ -0,0 +1,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 (); + } +} -- 2.30.2