summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlkrupp <lkrupp@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-07 09:21:58 +0000
committerlkrupp <lkrupp@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-07 09:21:58 +0000
commitf555c5f32e1919898e49dc68a67d6e6d46d6b6ac (patch)
tree071898257ae15c478b24070d443382183f54746f
parent3702cf131c81817c93ba7af4b07a930bd615c758 (diff)
downloadgcc-f555c5f32e1919898e49dc68a67d6e6d46d6b6ac.tar.gz
Check in forgotten test for fortran/65766
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228564 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/gfortran.dg/substr_alloc_string_comp_1.f9023
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/substr_alloc_string_comp_1.f90 b/gcc/testsuite/gfortran.dg/substr_alloc_string_comp_1.f90
new file mode 100644
index 00000000000..3a69a58fae3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/substr_alloc_string_comp_1.f90
@@ -0,0 +1,23 @@
+! { dg-do run }
+! PR fortran/65766
+! Substrings of allocatable string components of derived types
+program substr_derived_alloc_comp
+ implicit none
+
+ type t1
+ character(len=:), allocatable :: s
+ end type t1
+
+ character(len=*), parameter :: c = &
+ "0123456789abcdefghijklmnopqrstuvwxyz"
+
+ type(t1) x1
+
+ integer i
+
+ x1%s = c
+
+ do i = 1, 36
+ if (x1%s(i:) .ne. c(i:)) call abort
+ end do
+end program