2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr70673.f90
blob67856e0332e95623b664f53b7c37295fd294debe
1 ! { dg-do run }
3 ! Test the fix for PR70673
5 ! Contributed by David Kinniburgh <davidgkinniburgh@yahoo.co.uk>
7 module m
8 contains
9 subroutine s(inp)
10 character(*), intent(in) :: inp
11 character(:), allocatable :: a
12 a = a ! This used to ICE.
13 a = inp
14 a = a ! This used to ICE too
15 if ((len (a) .ne. 5) .or. (a .ne. "hello")) call abort
16 a = a(2:3) ! Make sure that temporary creation is not broken.
17 if ((len (a) .ne. 2) .or. (a .ne. "el")) call abort
18 deallocate (a)
19 a = a ! This would ICE too.
20 end subroutine s
21 end module m
23 use m
24 call s("hello")
25 end