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