re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)
[official-gcc.git] / gcc / testsuite / gfortran.dg / deferred_character_12.f90
blob51c50f2b59e2b477b4b26c4aace3a29f7dcf5489
1 ! { dg-do run }
3 ! Tests the fix for PR63232
5 ! Contributed by Balint Aradi <baradi09@gmail.com>
7 module mymod
8 implicit none
10 type :: wrapper
11 character(:), allocatable :: string
12 end type wrapper
14 contains
17 subroutine sub2(mystring)
18 character(:), allocatable, intent(out) :: mystring
20 mystring = "test"
22 end subroutine sub2
24 end module mymod
27 program test
28 use mymod
29 implicit none
31 type(wrapper) :: mywrapper
33 call sub2(mywrapper%string)
34 if (.not. allocated(mywrapper%string)) STOP 1
35 if (trim(mywrapper%string) .ne. "test") STOP 2
37 end program test