[flang][OpenMP] Added OpenMP 5.0 specification based semantic checks for sections...
authorNimish Mishra <neelam.nimish@gmail.com>
Thu, 30 Sep 2021 19:11:57 +0000 (00:41 +0530)
committernimishra <nimishra@amd.com>
Sat, 2 Oct 2021 03:10:53 +0000 (08:40 +0530)
commit063c5bc31b89d85aba9ea7c2aa0d2440ec468ed2
tree6d089cc399bb67ae27b757269c0819cb03e269f0
parent237e9059f781d4c07ba347fa89d371346b57db44
[flang][OpenMP] Added OpenMP 5.0 specification based semantic checks for sections construct and test case for simd construct

According to OpenMP 5.0 spec document, the following semantic restrictions have been dealt with in this patch.

1. [sections construct] Orphaned section directives are prohibited. That is, the section directives must appear within the sections construct and must not be encountered elsewhere in the sections region.

 Semantic checks for the following are not necessary, since use of orphaned section construct (i.e. without an enclosing sections directive) throws parser errors and control flow never reaches the semantic checking phase. Added a test case for the same.

2. [sections construct] Must be a structured block

Added test case and made changes to branching logic

3. [simd construct] Must be a structured block / A program that branches in or out of a function with declare simd is non conforming

4. Fixed !$omp do's handling of unlabeled CYCLEs

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D108904
flang/lib/Semantics/check-directive-structure.h
flang/test/Semantics/omp-sections02.f90 [new file with mode: 0644]
flang/test/Semantics/omp-sections03.f90 [new file with mode: 0644]
flang/test/Semantics/omp-simd01.f90