[Flang][OpenACC] Fix for branching out issue in OpenACC parallel construct.
authorsameeran joshi <sameeranjayant.joshi@amd.com>
Tue, 6 Oct 2020 04:51:06 +0000 (10:21 +0530)
committerSameeran joshi <joshisameeran17@gmail.com>
Mon, 19 Oct 2020 16:16:47 +0000 (21:46 +0530)
commit4a51691a85a1c048b9028d409b744a6235c55933
treef51f0e7bda77b7bca227e3ac451ec552cccc4391
parentb4bd194378851c2f421477d4147019d10f2420ac
[Flang][OpenACC] Fix for branching out issue in OpenACC parallel construct.

From OpenACC 3.0 Standards document
840 • A program may not branch into or out of an OpenACC parallel construct.
Exits are allowed provided it does not cause an exit outside the parallel region.

Test case exits out of the inner do loop, but it is still inside the parallel region.
Patch tries to extract labels from block attached to a construct,
If the exit is to a label not in the collected list then flags an error.

Reviewed By: tskeith

Differential Revision: https://reviews.llvm.org/D87906
flang/include/flang/Semantics/tools.h
flang/lib/Semantics/check-acc-structure.cpp
flang/lib/Semantics/check-do-forall.cpp
flang/lib/Semantics/tools.cpp
flang/test/Semantics/acc-branch.f90