OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [namelist_use.f90] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do run }
2
! This tests the fix for PR22010, where namelists were not being written to
3
! and read back from modules.  It has two namelists: one that is USE
4
! associated and another that is concatenated by USE and host association.
5
!
6
! Contributed by Paul Thomas  pault@gcc.gnu.org
7
!
8
module global
9
  character*4 :: aa
10
  integer :: ii
11
  real    :: rr
12
  namelist /nml1/ aa, ii, rr
13
  namelist /nml2/ aa
14
end module global
15
program namelist_use
16
  use global
17
  real    :: rrr
18
! Concatenate use and host associated variables - an extension.
19
  namelist /nml2/ ii, rrr    ! { dg-warning "already is USE associated" }
20
  open (10, status="scratch")
21
  write (10,*) "&NML1 aa='lmno' ii=1 rr=2.5 /"
22
  write (10,*) "&NML2 aa='pqrs' ii=2 rrr=3.5 /"
23
  rewind (10)
24
  read (10,nml=nml1,iostat=i)
25
  if ((i.ne.0).or.(aa.ne."lmno").or.(ii.ne.1).or.(rr.ne.2.5)) call abort ()
26
 
27
  read (10,nml=nml2,iostat=i)
28
  if ((i.ne.0).or.(aa.ne."pqrs").or.(ii.ne.2).or.(rrr.ne.3.5)) call abort ()
29
 
30
  close (10)
31
end program namelist_use
32
 
33
! { dg-final { cleanup-modules "global" } }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.