[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / char_result_10.f90
blobd14fd38151a703cadc00123c230fc7c7823ef9b6
1 ! { dg-do compile }
2 ! PR 18883: Fake result variables of non-constant length, with ENTRY
3 function s_to_c(chars)
4 character, pointer :: chars(:)
5 character(len=len(chars)) :: s_to_c, s_to_c_2
6 s_to_c = 'a'
7 return
8 entry s_to_c_2(chars)
9 s_to_c_2 = 'b'
10 return
11 end function s_to_c
13 program huj
15 implicit none
16 interface
17 function s_to_c(chars)
18 character, pointer :: chars(:)
19 character(len=len(chars)) :: s_to_c
20 end function s_to_c
22 function s_to_c_2(chars)
23 character, pointer :: chars(:)
24 character(len=len(chars)) :: s_to_c_2
25 end function s_to_c_2
26 end interface
28 character, pointer :: c(:)
29 character(3) :: s
31 allocate(c(5))
32 c = (/"a", "b", "c" /)
33 s = s_to_c(c)
34 s = s_to_c_2(c)
36 end program huj