diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-02-28 11:49:29 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2024-02-28 11:49:29 +0100 |
commit | db465230cccf0844e803dd6701756054fe97244a (patch) | |
tree | 0050a389ba7d604596848b0a90be74ee4bde2b6f | |
parent | 82ebfd35da49e5df87da132a7b8c41baeebc57b4 (diff) | |
download | gcc-db465230cccf0844e803dd6701756054fe97244a.zip gcc-db465230cccf0844e803dd6701756054fe97244a.tar.gz gcc-db465230cccf0844e803dd6701756054fe97244a.tar.bz2 |
testsuite: Add testcase for recently fixed PR [PR114075]
This adds testcase from PR114075 which has been fixed by the r14-9205
change on s390x-linux with -march=z13.
2024-02-28 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/114075
* gcc.dg/gomp/pr114075.c: New test.
-rw-r--r-- | gcc/testsuite/gcc.dg/gomp/pr114075.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/pr114075.c b/gcc/testsuite/gcc.dg/gomp/pr114075.c new file mode 100644 index 0000000..c5c9cda --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr114075.c @@ -0,0 +1,31 @@ +/* PR tree-optimization/114075 */ +/* { dg-do run } */ +/* { dg-options "-O2 -fopenmp-simd -Wno-psabi" } */ + +typedef float V __attribute__((__vector_size__ (16))); + +__attribute__((__always_inline__)) inline static float +foo (V a) +{ + float r = 0; +#pragma omp simd reduction(+:r) + for (unsigned long i = 0; i < (sizeof (a) / sizeof (float)); i++) + r += a[i]; + return r; +} + +int +main () +{ + static const struct { V a; float r; } t[] = { + { (V) { -17.0f, -18.0f, -19.0f, 20.0f }, -34.0f }, + { (V) { 18.5f, 19.125f, 20.5f, -38.25f }, 19.875f }, + { (V) { -8.25f, 16.75f, -42.5f, -18.75f }, -52.75f } + }; + for (unsigned long i = 0; i < (sizeof (t) / sizeof (t[0])); i++) + { + float r = foo (t[i].a); + if (r != t[i].r) + __builtin_abort (); + } +} |