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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [namelist_71.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! PR47778 Reading array of structures from namelist
3
! Test case derived from the reporters test case.
4
program test_nml
5
type field_descr
6
  integer number
7
end type
8
type fsetup
9
  type (field_descr), dimension(3) :: vel ! 3 velocity components
10
  type (field_descr), dimension(3) :: scal ! 3 scalars
11
end type
12
type (fsetup) field_setup
13
namelist /nl_setup/ field_setup
14
field_setup%vel%number = 0
15
field_setup%scal%number = 0
16
! write(*,nml=nl_setup)
17
open(10, status="scratch")
18
write(10,'(a)') "&nl_setup"
19
write(10,'(a)') " field_setup%vel(1)%number=  3,"
20
write(10,'(a)') " field_setup%vel(2)%number=  9,"
21
write(10,'(a)') " field_setup%vel(3)%number=  27,"
22
write(10,'(a)') " field_setup%scal(1)%number=  2,"
23
write(10,'(a)') " field_setup%scal(2)%number=  4,"
24
write(10,'(a)') " field_setup%scal(3)%number=  8,"
25
write(10,'(a)') "/"
26
rewind(10)
27
read(10,nml=nl_setup)
28
if (field_setup%vel(1)%number .ne. 3) call abort
29
if (field_setup%vel(2)%number .ne. 9) call abort
30
if (field_setup%vel(3)%number .ne. 27) call abort
31
if (field_setup%scal(1)%number .ne. 2) call abort
32
if (field_setup%scal(2)%number .ne. 4) call abort
33
if (field_setup%scal(3)%number .ne. 8) call abort
34
!write(*,nml=nl_setup)
35
end program test_nml
36
 

powered by: WebSVN 2.1.0

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