llvm-project/clang/test/OpenMP/scope_messages.cpp
Fazlay Rabbi e4c7298bea [OpenMP 5.1] Parsing and Sema support for scope directive
structured-block

where clause is one of the following:

private(list)
reduction([reduction-modifier ,] reduction-identifier : list)
nowait

Differential Revision: https://reviews.llvm.org/D157933
2023-08-24 18:13:52 -07:00

14 lines
504 B
C++

// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 %s -verify=expected,omp51
// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 %s -verify=expected,omp51
void test1()
{
int var1;
int var2;
int var3 = 1;
// expected-error@+1 {{directive '#pragma omp scope' cannot contain more than one 'nowait' clause}} //omp51-error@+1{{unexpected OpenMP clause 'firstprivate' in directive '#pragma omp scope'}}
#pragma omp scope private(var1) firstprivate(var3) nowait nowait
{ var1 = 123; ++var2; var3 = 2;}
}