aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr58472.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr58472.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr58472.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr58472.c b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr58472.c
new file mode 100644
index 000000000..355ca4008
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr58472.c
@@ -0,0 +1,16 @@
+/* PR tree-optimization/58472 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -fopenmp" } */
+
+float a[1024], b[1024];
+
+float
+foo ()
+{
+ float s = 0.f;
+ unsigned int i;
+#pragma omp simd reduction(+:s)
+ for (i = 0; i < 1024; ++i)
+ s += a[i] * b[i];
+ return s;
+}