File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2285,6 +2285,21 @@ void OmpStructureChecker::Leave(const parser::OmpClauseList &) {
22852285 }
22862286 }
22872287 }
2288+
2289+ // 2.11.5 Simd construct restriction (OpenMP 5.1)
2290+ if (auto *sl_clause{FindClause (llvm::omp::Clause::OMPC_safelen)}) {
2291+ if (auto *o_clause{FindClause (llvm::omp::Clause::OMPC_order)}) {
2292+ const auto &orderClause{
2293+ std::get<parser::OmpClause::Order>(o_clause->u )};
2294+ if (std::get<parser::OmpOrderClause::Type>(orderClause.v .t ) ==
2295+ parser::OmpOrderClause::Type::Concurrent) {
2296+ context_.Say (sl_clause->source ,
2297+ " The `SAFELEN` clause cannot appear in the `SIMD` directive "
2298+ " with `ORDER(CONCURRENT)` clause" _err_en_US);
2299+ }
2300+ }
2301+ }
2302+
22882303 // Sema checks related to presence of multiple list items within the same
22892304 // clause
22902305 CheckMultListItems ();
Original file line number Diff line number Diff line change 390390 enddo
391391 ! $omp end parallel
392392
393+ ! ERROR: The `SAFELEN` clause cannot appear in the `SIMD` directive with `ORDER(CONCURRENT)` clause
394+ ! $omp simd order(concurrent) safelen(1+2)
395+ do i = 1 , N
396+ a = 3.14
397+ enddo
398+
393399! 2.11.1 parallel-do-clause -> parallel-clause |
394400! do-clause
395401
You can’t perform that action at this time.
0 commit comments