aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr58472.c
blob: 355ca4008bfcc20008bc7f792c4f3b7fc233175a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}