// depend-clause
case parser::OmpBlockDirective::Directive::Target: {
PushContext(beginDir.source, OmpDirective::TARGET);
- OmpClauseSet allowed{OmpClause::IF, OmpClause::PRIVATE, OmpClause::MAP,
- OmpClause::DEPEND, OmpClause::FIRSTPRIVATE, OmpClause::IS_DEVICE_PTR};
+ OmpClauseSet allowed{OmpClause::IF, OmpClause::PRIVATE,
+ OmpClause::FIRSTPRIVATE, OmpClause::MAP, OmpClause::IS_DEVICE_PTR,
+ OmpClause::DEPEND};
SetContextAllowed(allowed);
OmpClauseSet allowedOnce{
OmpClause::DEVICE, OmpClause::DEFAULTMAP, OmpClause::NOWAIT};
void OmpStructureChecker::Enter(const parser::OmpDefaultClause &) {
CheckAllowed(OmpClause::DEFAULT);
}
-void OmpStructureChecker::Enter(const parser::OmpDefaultmapClause &) {
+void OmpStructureChecker::Enter(const parser::OmpDefaultmapClause &x) {
CheckAllowed(OmpClause::DEFAULTMAP);
+ using VariableCategory = parser::OmpDefaultmapClause::VariableCategory;
+ if (!std::get<std::optional<VariableCategory>>(x.t)) {
+ context_.Say(GetContext().clauseSource,
+ "The scalar VARIABLECATEGORY must be specified on the DEFAULTMAP "
+ "clause"_err_en_US);
+ }
}
void OmpStructureChecker::Enter(const parser::OmpDependClause &) {
CheckAllowed(OmpClause::DEPEND);
enddo
!$omp end target
-
!ERROR: At most one DEVICE clause can appear on the TARGET directive
!$omp target device(0) device(1)
do i = 1, N
enddo
!$omp end target
+ !$omp target defaultmap(tofrom:scalar)
+ do i = 1, N
+ a = 3.14
+ enddo
+ !$omp end target
+
+ !ERROR: The scalar VARIABLECATEGORY must be specified on the DEFAULTMAP clause
+ !$omp target defaultmap(tofrom)
+ do i = 1, N
+ a = 3.14
+ enddo
+ !$omp end target
+
!ERROR: At most one DEFAULTMAP clause can appear on the TARGET directive
!$omp target defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
do i = 1, N