348 changes: 254 additions & 94 deletions flang/lib/Semantics/check-omp-structure.cpp

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions flang/lib/Semantics/resolve-names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6300,6 +6300,15 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPBlockConstruct &x) {
case parser::OmpBlockDirective::Directive::Workshare:
PushContext(beginDir.source, OmpDirective::WORKSHARE);
break;
case parser::OmpBlockDirective::Directive::ParallelWorkshare:
PushContext(beginDir.source, OmpDirective::PARALLEL_WORKSHARE);
break;
case parser::OmpBlockDirective::Directive::TargetTeams:
PushContext(beginDir.source, OmpDirective::TARGET_TEAMS);
break;
case parser::OmpBlockDirective::Directive::TargetParallel:
PushContext(beginDir.source, OmpDirective::TARGET_PARALLEL);
break;
default:
// TODO others
break;
Expand Down
4 changes: 4 additions & 0 deletions flang/test/Semantics/missing_newline.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
! RUN: echo -n "end program" > %t.f90
! RUN: %f18 -fparse-only %t.f90
! RUN: echo -ne "\rend program" > %t.f90
! RUN: %f18 -fparse-only %t.f90
509 changes: 509 additions & 0 deletions flang/test/Semantics/omp-combined-constructs.f90

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions flang/test/Semantics/omp-device-constructs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ program main
enddo
!$omp end teams

!$omp target teams num_teams(2) defaultmap(tofrom:scalar)
do i = 1, N
a = 3.14
enddo
!$omp end target teams

!$omp target map(tofrom:a)
do i = 1, N
a = 3.14
Expand Down