aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/gomp/pr100450.c
blob: a6d2a2829ff5137ae6bfd323930e5e6ab6fc9563 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* PR c/100450 */
/* { dg-do compile } */
/* { dg-options "-fopenmp -save-temps -Wunknown-pragmas" } */

#define TEST(T) { \
     {T} \
}
#define CLAUSES reduction(+:red)
#define PARALLEL_FOR(X) TEST({ \
_Pragma("omp for CLAUSES") \
X \
})

void foo()
{
  int red = 0;
  int A[3] = {};
  #pragma omp parallel shared(red)
  PARALLEL_FOR( for(int i=0; i < 3; i++) red += A[i]; )
}