2009-10-05 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_29.f90
blob55bff0c906fca5bebd4c672f42a9976ed91ed074
1 ! { dg-do run }
2 ! Checks the fix for PR30878, in which the inclusion
3 ! of an implicit function result variable in a namelist
4 ! would cause an error.
6 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
8 character(80) :: buffer
9 if (f1 (buffer) .ne. 42) call abort ()
10 CONTAINS
11 INTEGER FUNCTION F1 (buffer)
12 NAMELIST /mynml/ F1
13 integer :: check
14 character(80) :: buffer
15 F1 = 42
16 write (buffer, nml = mynml)
17 F1 = 0
18 READ (buffer, nml = mynml)
19 end function
20 END