summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/pr26412.c
blob: 6baecfe6895b9977bd0ca2f5965739041c5e9b9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* PR middle-end/26412 */
/* { dg-do compile } */

extern double a[];
extern int b;

double
test (void)
{
  int i;
  double c = 0;

#pragma omp parallel for private(i) reduction(+:c)
  for (i = 0; i < 10000; i++)
    c += a[b];

  return c;
}