diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr59501-1.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr59501-1.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr59501-1.c b/gcc/testsuite/gcc.target/i386/pr59501-1.c new file mode 100644 index 00000000000..6a104eef1ad --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr59501-1.c @@ -0,0 +1,30 @@ +/* PR target/59501 */ +/* { dg-do run } */ +/* { dg-options "-O2 -mavx -mno-accumulate-outgoing-args" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include CHECK_H + +typedef double V __attribute__ ((vector_size (32))); + +__attribute__((noinline, noclone)) V +foo (double *x, unsigned *y) +{ + V r = { x[y[0]], x[y[1]], x[y[2]], x[y[3]] }; + return r; +} + +static void +TEST (void) +{ + double a[16]; + unsigned b[4] = { 5, 0, 15, 7 }; + int i; + for (i = 0; i < 16; i++) + a[i] = 0.5 + i; + V v = foo (a, b); + if (v[0] != 5.5 || v[1] != 0.5 || v[2] != 15.5 || v[3] != 7.5) + __builtin_abort (); +} |