[flang] Support allocate array from scalar source in runtime
authorPeixin Qiao <qiaopeixin@huawei.com>
Wed, 1 Feb 2023 13:09:02 +0000 (21:09 +0800)
committerPeixin Qiao <qiaopeixin@huawei.com>
Wed, 1 Feb 2023 13:09:02 +0000 (21:09 +0800)
commitf783c9bbbe576ad580aaaf6841ce8f3646cd0824
tree0f0c834cc9e24cc7fc28ea9657ccce7762bd9f9c
parente0374fb2f447c5302fec21a2999c5ea082661db6
[flang] Support allocate array from scalar source in runtime

As Fortran 2018 9.7.1.2(7), the value of each element of allocate object
becomes the value of source when the allocate object is array and the
source is scalar.

Fix #60090.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D142112
flang/lib/Lower/Allocatable.cpp
flang/runtime/allocatable.cpp
flang/runtime/assign.cpp
flang/runtime/assign.h
flang/runtime/pointer.cpp
flang/unittests/Runtime/Allocatable.cpp
flang/unittests/Runtime/Pointer.cpp