Merged with mainline at revision 128810.
[official-gcc.git] / gcc / testsuite / gfortran.dg / char_length_9.f90
blobdbec68cd8c3916d6230c6e34a7a4b5806c931f57
1 ! { dg-do compile }
2 ! Test the fix for a regression caused by the first fix of PR31879.
3 ! Reported by Tobias Burnus <burnus@gcc.gnu.org>
5 MODULE input_val_types
6 IMPLICIT NONE
7 INTEGER, PARAMETER :: default_string_length=80
8 TYPE val_type
9 CHARACTER(len=default_string_length), DIMENSION(:), POINTER :: c_val
10 END TYPE val_type
11 CONTAINS
12 SUBROUTINE val_get (val, c_val)
13 TYPE(val_type), POINTER :: val
14 CHARACTER(LEN=*), INTENT(out) :: c_val
15 INTEGER :: i, l_out
16 i=1
17 c_val((i-1)*default_string_length+1:MIN (l_out, i*default_string_length)) = &
18 val%c_val(i)(1:MIN (80, l_out-(i-1)*default_string_length))
19 END SUBROUTINE val_get
20 END MODULE input_val_types
22 ! { dg-final { cleanup-modules "input_val_types" } }