aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c
blob: 9991db07013bfb554e1beac14b109565fc12e71e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* { dg-do run } */

int
main(void)
{
#define I 5
#define N 32
#define A 8

  int a = A;
  int s = I;

#pragma acc parallel vector_length(N) copy(s)
  {
    int i;
#pragma acc loop reduction(+:s)
    for (i = 0; i < N; ++i)
      s += a;
  }

  if (s != I + N * A)
    __builtin_abort();

  return 0;
}