[flang][OpenMP] Add semantic check for target nesting
authorPeixinQiao <qiaopeixin@huawei.com>
Wed, 18 Aug 2021 01:40:52 +0000 (09:40 +0800)
committerPeixinQiao <qiaopeixin@huawei.com>
Wed, 18 Aug 2021 01:40:52 +0000 (09:40 +0800)
commit3883e266f4abd33e19a7c656dde19b6f5c7fc134
tree9e0dcdc6ccbef438639f9eb51434b02af70fb65e
parent2379949aadcee8d4028dec0508f88bda290636bc
[flang][OpenMP] Add semantic check for target nesting

This patch implements the following check for TARGET construct:
```
OpenMP Version 5.0 Target construct restriction: If a target update,
target data, target enter data, or target exit data construct is
encountered during execution of a target region, the behavior is
unspecified.
```

Also add one test case for the check.

Reviewed By: kiranchandramohan, clementval

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