summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr70673_2.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/pr70673_2.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/pr70673_2.f9025
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pr70673_2.f90 b/gcc/testsuite/gfortran.dg/pr70673_2.f90
new file mode 100644
index 00000000000..ba2ce2f2a96
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr70673_2.f90
@@ -0,0 +1,25 @@
+! { dg-do compile }
+!
+! Test the fix for PR70673
+!
+! Contributed by David Kinniburgh <davidgkinniburgh@yahoo.co.uk>
+!
+module m
+contains
+ subroutine s(inp)
+ character(*), intent(in) :: inp
+ character(:), allocatable :: a
+ a = a ! This used to ICE.
+ a = inp
+ a = a ! This used to ICE too
+ if ((len (a) .ne. 5) .or. (a .ne. "hello")) STOP 1
+ a = a(2:3) ! Make sure that temporary creation is not broken.
+ if ((len (a) .ne. 2) .or. (a .ne. "el")) STOP 2
+ deallocate (a)
+ a = a ! This would ICE too.
+ end subroutine s
+end module m
+
+ use m
+ call s("hello")
+end