[Flang][OpenMP] Add semantic checks for OpenMP Workshare Construct
authorPraveen <praveen@compilertree.com>
Tue, 19 Jan 2021 12:58:44 +0000 (18:28 +0530)
committerPraveen <praveen@compilertree.com>
Tue, 19 Jan 2021 14:30:12 +0000 (20:00 +0530)
commitc42f5ca3d84c7b0d4e735ab3794718c429369309
treeee66429be126afa611c8fe274d318bb4b4775379
parent2988f940d861f0fa76bc5b749772f2b9239d5a1b
[Flang][OpenMP] Add semantic checks for OpenMP Workshare Construct

Add Semantic checks for OpenMP 4.5 - 2.7.4 Workshare Construct.

 - The structured block in a workshare construct may consist of only
   scalar or array assignments, forall or where statements,
   forall, where, atomic, critical or parallel constructs.

 - All array assignments, scalar assignments, and masked array
   assignments must be intrinsic assignments.

 - The construct must not contain any user defined function calls unless
   the function is ELEMENTAL.

Test cases : omp-workshare03.f90, omp-workshare04.f90, omp-workshare05.f90

Resolve test cases (omp-workshare01.f90 and omp-workshare02.f90) marked as XFAIL

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D93091
flang/lib/Semantics/check-omp-structure.cpp
flang/lib/Semantics/check-omp-structure.h
flang/test/Semantics/omp-workshare01.f90
flang/test/Semantics/omp-workshare02.f90
flang/test/Semantics/omp-workshare03.f90 [new file with mode: 0644]
flang/test/Semantics/omp-workshare04.f90 [new file with mode: 0644]
flang/test/Semantics/omp-workshare05.f90 [new file with mode: 0644]