PR c/29467
[official-gcc.git] / gcc / testsuite / gfortran.dg / deferred_type_param_6.f90
blobeb0077840f4fd5c3288ecf199ef8dda9099a32ed
1 ! { dg-do run }
3 ! PR fortran/51055
4 ! PR fortran/49110
7 subroutine test()
8 implicit none
9 integer :: i = 5
10 character(len=:), allocatable :: s1
11 call sub(s1, i)
12 if (len(s1) /= 5) call abort()
13 if (s1 /= "ZZZZZ") call abort()
14 contains
15 subroutine sub(str,j)
16 character(len=:), allocatable :: str
17 integer :: j
18 str = REPEAT("Z",j)
19 if (len(str) /= 5) call abort()
20 if (str /= "ZZZZZ") call abort()
21 end subroutine sub
22 end subroutine test
24 program a
25 character(len=:),allocatable :: s
26 integer :: j=2
27 s = repeat ('x', j)
28 if (len(repeat(' ',j)) /= 2) call abort()
29 if (repeat('y',j) /= "yy") call abort()
30 if (len(s) /= 2) call abort()
31 if (s /= "xx") call abort()
32 call test()
33 end program a