ieee_9.f90: XFAIL on arm*-*-gnueabi[hf].
[official-gcc.git] / gcc / testsuite / gfortran.dg / function_charlen_2.f90
blob29b925bcc6feaa532fcb65fa12b75f9b5a2f7b46
1 ! { dg-do compile }
2 ! Tests the fix for PR34429 in which function charlens that were
3 ! USE associated would cause an error.
5 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
7 module m
8 integer, parameter :: l = 2
9 character(2) :: cl
10 end module m
12 program test
13 implicit none
14 integer, parameter :: l = 5
15 character(len = 10) :: c
16 character(4) :: cl
17 c = f ()
18 if (g () /= "2") STOP 1
19 contains
20 character(len = l) function f ()
21 use m
22 if (len (f) /= 2) STOP 2
23 f = "a"
24 end function f
25 character(len = len (cl)) function g ()
26 use m
27 g = "4"
28 if (len (g) == 2) g= "2"
29 end function g
30 end program test