2016-01-15 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / deferred_character_13.f90
blob822cc5de3a841bab30ec19ae7486494ea94da225
1 ! { dg-do run }
3 ! Tests the fix for PR49630 comment #3.
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 module abc
8 implicit none
10 type::abc_type
11 contains
12 procedure::abc_function
13 end type abc_type
15 contains
17 function abc_function(this)
18 class(abc_type),intent(in)::this
19 character(:),allocatable::abc_function
20 allocate(abc_function,source="hello")
21 end function abc_function
23 subroutine do_something(this)
24 class(abc_type),intent(in)::this
25 if (this%abc_function() .ne. "hello") call abort
26 end subroutine do_something
28 end module abc
31 use abc
32 type(abc_type) :: a
33 call do_something(a)
34 end