diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp --- a/flang/lib/Lower/OpenMP.cpp +++ b/flang/lib/Lower/OpenMP.cpp @@ -1538,6 +1538,11 @@ // Collect the loops to collapse. auto *doConstructEval = &eval.getFirstNestedEvaluation(); + if (doConstructEval->getIf() + ->IsDoConcurrent()) { + TODO(converter.getCurrentLocation(), + "Do Concurrent in Worksharing loop construct"); + } std::int64_t collapseValue = Fortran::lower::getCollapseValue(loopOpClauseList); diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp --- a/flang/lib/Semantics/resolve-directives.cpp +++ b/flang/lib/Semantics/resolve-directives.cpp @@ -597,7 +597,11 @@ const parser::DoConstruct &x) { using Bounds = parser::LoopControl::Bounds; if (x.GetLoopControl()) { - return &std::get(x.GetLoopControl()->u).name.thing; + if (const Bounds * b{std::get_if(&x.GetLoopControl()->u)}) { + return &b->name.thing; + } else { + return nullptr; + } } else { context_ .Say(std::get>(x.t).source, diff --git a/flang/test/Lower/OpenMP/Todo/omp-doconcurrent.f90 b/flang/test/Lower/OpenMP/Todo/omp-doconcurrent.f90 new file mode 100644 --- /dev/null +++ b/flang/test/Lower/OpenMP/Todo/omp-doconcurrent.f90 @@ -0,0 +1,10 @@ +! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s +! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s + +! CHECK: not yet implemented: Do Concurrent in Worksharing loop construct +subroutine sb() + !$omp do + do concurrent(i=1:10) + print *, i + end do +end subroutine