diff --git a/flang/lib/Semantics/check-omp-structure.h b/flang/lib/Semantics/check-omp-structure.h --- a/flang/lib/Semantics/check-omp-structure.h +++ b/flang/lib/Semantics/check-omp-structure.h @@ -155,8 +155,10 @@ void Enter(const parser::OmpClause::Reduction &); void Enter(const parser::OmpClause::Safelen &); void Enter(const parser::OmpClause::Shared &); + void Enter(const parser::OmpClause::Simd &); void Enter(const parser::OmpClause::Simdlen &); void Enter(const parser::OmpClause::TaskReduction &); + void Enter(const parser::OmpClause::Threads &); void Enter(const parser::OmpClause::ThreadLimit &); void Enter(const parser::OmpClause::To &); void Enter(const parser::OmpClause::Link &); diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp --- a/flang/lib/Semantics/check-omp-structure.cpp +++ b/flang/lib/Semantics/check-omp-structure.cpp @@ -433,6 +433,8 @@ CHECK_SIMPLE_CLAUSE(Hint, OMPC_hint) CHECK_SIMPLE_CLAUSE(ProcBind, OMPC_proc_bind) CHECK_SIMPLE_CLAUSE(DistSchedule, OMPC_dist_schedule) +CHECK_SIMPLE_CLAUSE(Simd, OMPC_simd) +CHECK_SIMPLE_CLAUSE(Threads, OMPC_threads) CHECK_REQ_SCALAR_INT_CLAUSE(Allocator, OMPC_allocator) CHECK_REQ_SCALAR_INT_CLAUSE(Grainsize, OMPC_grainsize) diff --git a/flang/test/Semantics/omp-clause-validity01.f90 b/flang/test/Semantics/omp-clause-validity01.f90 --- a/flang/test/Semantics/omp-clause-validity01.f90 +++ b/flang/test/Semantics/omp-clause-validity01.f90 @@ -485,6 +485,14 @@ !$omp ordered depend(source) !ERROR: Internal: no symbol found for 'i' !$omp ordered depend(sink:i-1) + !ERROR: At most one DEPEND clause can appear on the ORDERED directive + !$omp ordered depend(source) depend(source) + !ERROR: At most one THREADS clause can appear on the ORDERED directive + !$omp ordered threads threads + !$omp end ordered + !ERROR: At most one SIMD clause can appear on the ORDERED directive + !$omp ordered simd simd + !$omp end ordered !$omp flush (c) !$omp flush acq_rel !$omp flush release diff --git a/llvm/include/llvm/Frontend/OpenMP/OMP.td b/llvm/include/llvm/Frontend/OpenMP/OMP.td --- a/llvm/include/llvm/Frontend/OpenMP/OMP.td +++ b/llvm/include/llvm/Frontend/OpenMP/OMP.td @@ -455,7 +455,7 @@ ]; } def OMP_Ordered : Directive<"ordered"> { - let allowedClauses = [ + let allowedOnceClauses = [ VersionedClause, VersionedClause, VersionedClause