This is an archive of the discontinued LLVM Phabricator instance.

[flang] Support allocate array from scalar source in runtime
ClosedPublic

Authored by peixin on Jan 19 2023, 6:47 AM.

Details

Summary

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.

Diff Detail

Event Timeline

peixin created this revision.Jan 19 2023, 6:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2023, 6:47 AM
peixin requested review of this revision.Jan 19 2023, 6:47 AM

Thanks for implementing this and, especially, for adding the comments.

Can you please add a test to .../llvm-project/flang/unittests/Runtime?

peixin updated this revision to Diff 492993.EditedJan 28 2023, 4:31 AM

Sorry for the late reply due to the Chinese Lunar New Year.

Add the unittests as @PeteSteinfeld mentioned.

PeteSteinfeld accepted this revision.Jan 28 2023, 5:25 PM

Thanks, @peixin! All builds and tests correctly and looks good.

This revision is now accepted and ready to land.Jan 28 2023, 5:25 PM

Thanks @PeteSteinfeld .

Will wait for one more day before landing in case other reviewers have comments.