[flang] Create a temporary of the correct size when lowering SetLength
This patch creates a temporary of the appropriate length while lowering SetLength. The corresponding character can be truncated or padded if necessary. This fix issue with array constructor in argument and also with statement function. ``` character(7) :: str = "1234567" call s(str(1:1)) contains subroutine s(a) character(*) :: a call s2([Character(3)::a]) end subroutine subroutine s2(c) character(3) :: c(1) print "(4a)", c(1), "end" end subroutine end ``` The example prior the patch prints `123end` instead of `1. end` Reviewed By: PeteSteinfeld, jeanPerier Differential Revision: https://reviews.llvm.org/D132464
Loading
Please sign in to comment