2008-07-06 Kai Tietz <kai.tietz@onevision.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / auto_char_len_4.f90
blob3749abd8ed3075d2174c0bee30cae29174c38514
1 ! { dg-do compile }
2 ! Tests the fix for PR25087, in which the following invalid code
3 ! was not detected.
5 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
7 SUBROUTINE s(n)
8 CHARACTER(LEN=n), EXTERNAL :: a ! { dg-error "must have an explicit interface" }
9 interface
10 function b (m) ! This is OK
11 CHARACTER(LEN=m) :: b
12 integer :: m
13 end function b
14 end interface
15 write(6,*) a(n)
16 write(6,*) b(n)
17 write(6,*) c()
18 contains
19 function c () ! This is OK
20 CHARACTER(LEN=n):: c
21 c = ""
22 end function c
23 END SUBROUTINE s