[flang][OpenMP] Add semantic check for close nesting of `master` regions
authorArnamoy Bhattacharyya <arnamoy.bhattacharyya@huawei.com>
Thu, 13 May 2021 18:56:07 +0000 (14:56 -0400)
committerArnamoy Bhattacharyya <arnamoy.bhattacharyya@huawei.com>
Thu, 13 May 2021 18:58:37 +0000 (14:58 -0400)
commitb766576d38d304c630de5430053d06dfc7784628
treeba97f2520c46d8765265f27e0c4e3f0d8bfdbcbd
parenta249ffa42137431d44d7db1d04f122300bc51533
[flang][OpenMP] Add semantic check for close nesting of `master` regions

This patch implements the following semantic check:
```
A master region may not be closely nested inside a work-sharing, loop, atomic, task, or taskloop region.
```

Adds a test case and also modifies a couple of existing test cases to include the check.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D100228
flang/lib/Semantics/check-omp-structure.cpp
flang/lib/Semantics/check-omp-structure.h
flang/test/Semantics/omp-nested-master.f90 [new file with mode: 0644]
flang/test/Semantics/omp-ordered-simd.f90