[AArch64] Fix PR87511
[official-gcc.git] / gcc / testsuite / gfortran.dg / array_substring.f90
blobea80556cfc1984d6819ec77d5651371b91bc6f07
1 ! { dg-do compile }
3 ! PR fortran/83522
5 ! Contributed by urbanjost and Jerry DeLisle
7 program testit
8 character(len=:),allocatable :: strings(:)
9 integer :: i
10 strings=[character(len=2) :: 'AA','BB']
11 write(*,*)strings(:)(:) ! { dg-error "Substring reference of nonscalar not permitted" }
12 !strings(:)(:) ! Parse error: "Invalid character in name"
13 strings(:)(:) = 'x' ! { dg-error "Substring reference of nonscalar not permitted" }
14 do i=1, size(strings)
15 write(*,*)strings(i)(:) ! This is valid and works
16 end do
17 end program testit