[flang] Make sure derived-type finalization is done before return
authorValentin Clement <clementval@gmail.com>
Wed, 1 Feb 2023 13:45:53 +0000 (14:45 +0100)
committerValentin Clement <clementval@gmail.com>
Wed, 1 Feb 2023 13:56:18 +0000 (14:56 +0100)
commitd65aeeb360e279dfc7c9ddf7c8555b585e9df0d4
treec94782b6b457cc233bc558c1fd7d1efe75feeb67
parent3d736c7dc1fd487f24db4545fa5bffada2fa60f8
[flang] Make sure derived-type finalization is done before return

Finalization needs to be done before the terminator. In case
of end program, this was done after it and trigger a verifier error.
This patch fixes this case.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D143055
flang/lib/Lower/Bridge.cpp
flang/test/Lower/derived-type-finalization.f90