]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gfortran.dg/pr70673.f90
1449130274b64c94d31b1261153c337417213a58
[thirdparty/gcc.git] / gcc / testsuite / gfortran.dg / pr70673.f90
1 ! { dg-do run }
2 !
3 ! Test the fix for PR70673
4 !
5 ! Contributed by David Kinniburgh <davidgkinniburgh@yahoo.co.uk>
6 !
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")) STOP 1
16 a = a(2:3) ! Make sure that temporary creation is not broken.
17 if ((len (a) .ne. 2) .or. (a .ne. "el")) STOP 2
18 deallocate (a)
19 end subroutine s
20 end module m
21
22 use m
23 call s("hello")
24 end