| ! Test fixes for PR109451 |
| ! Contributed by Harald Anlauf <anlauf@gcc.gnu.org> |
| character(4) :: c(2) = ["abcd","efgh"] |
| character(len=*), intent(in) :: a(:) |
| character(:), allocatable :: b(:) |
| associate (q => b(:)) ! no ICE but print repeated first element |
| print *, q ! Checked with dg-output |
| call test (b, ["bc ","fg "], 4) |
| associate (q => b(:)(:)) ! ICE |
| associate (r => q(:)(1:3)) |
| call test (r, a(:)(1:3), 5) |
| associate (q => b(:)(2:3)) |
| call test (q, a(:)(2:3), 6) |
| ! The associate vars in dsc0 had string length not set |
| character(len=*), intent(in) :: a(:) |
| subroutine test (x, y, i) |
| character(len=*), intent(in) :: x(:), y(:) |
| if (any (x .ne. y)) stop i |
| ! { dg-output " abcdefgh" } |