From bbf3abfa7377acfb5e8d5f34239807444dea9caa Mon Sep 17 00:00:00 2001 From: Louis Krupp Date: Wed, 7 Oct 2015 09:21:58 +0000 Subject: [PATCH] Check in forgotten test for fortran/65766 From-SVN: r228564 --- .../substr_alloc_string_comp_1.f90 | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/substr_alloc_string_comp_1.f90 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 -- 2.30.2