Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / proc_ptr_comp_15.f90
blob9f15d14dbe4ba00c2e1914f16da9462e2ab10854
1 ! { dg-do run }
3 ! PR 41106: [F03] Procedure Pointers with CHARACTER results
5 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
7 module m
8 type :: t
9 procedure(character(len=5)), pointer, nopass :: ptr
10 end type
11 contains
12 function abc()
13 character(len=5) :: abc
14 abc = 'abcde'
15 end function abc
16 end module m
18 use m
19 type(t) :: x
20 character(len=5) :: str
21 x%ptr => abc
22 print *,x%ptr()
23 str = x%ptr()
24 if (str/='abcde') call abort()
25 end
27 ! { dg-final { cleanup-modules "m" } }