[flang] Fix semantic analysis for "forall" targeted by "label"
authorPeixinQiao <qiaopeixin@huawei.com>
Fri, 8 Apr 2022 16:27:53 +0000 (00:27 +0800)
committerPeixinQiao <qiaopeixin@huawei.com>
Fri, 8 Apr 2022 16:27:53 +0000 (00:27 +0800)
commiteb4d5b852e1d922bce2f538bbafb688786ae2738
tree880789c8f79e0bd57b333176f57dd5683a419333
parent34e1b4774a47d2cc92d8b32aaa25778b7acf9255
[flang] Fix semantic analysis for "forall" targeted by "label"

As Fortran 2018 3.18 states, the branch target statement can be
`forall-construct-stmt`, but cannot be `forall-stmt`. `forall-stmt` is
wrapped by `Statement` in `action-stmt` and `action-stmt` can be one
branch target statement. Fix the semantic analysis and add two
regression test cases in lowering.

Reviewed By: Jean Perier

Differential Revision: https://reviews.llvm.org/D123373
flang/lib/Semantics/resolve-labels.cpp
flang/test/Lower/forall/forall-construct-4.f90 [new file with mode: 0644]