[Flang] Fix ALLOCATE with MOLD where MOLD is a scalar
authorPeter Steinfeld <psteinfeld@nvidia.com>
Mon, 6 Mar 2023 21:00:10 +0000 (13:00 -0800)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Thu, 9 Mar 2023 14:07:50 +0000 (06:07 -0800)
commit34ed7db9e1f65ef641776b3c5dff594d5183cab3
tree28031adf39f73f29ac27575bf244350abeaf9f4a
parent56164c3eb450c1de2d7326a545e4c7bbc57e91b5
[Flang] Fix ALLOCATE with MOLD where MOLD is a scalar

We were failing tests where an ALLOCATE statement that allocated an
array had a non-character scalar MOLD argument.

I fixed this by merging the code for ALLOCATE statements with MOLD and
SOURCE arguments.

Differential Revision: https://reviews.llvm.org/D145418
flang/lib/Lower/Allocatable.cpp
flang/test/Lower/allocate-mold.f90