[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_13.f90
blob185b522e7f0328b8a4f4feb824331450b6d2bfc3
1 !{ dg-do run }
2 ! Tests simple derived types.
3 ! Provided by Paul Thomas - pault@gcc.gnu.org
5 program namelist_13
7 type :: yourtype
8 integer, dimension(2) :: yi = (/8,9/)
9 real, dimension(2) :: yx = (/80.,90./)
10 character(len=2) :: ych = "xx"
11 end type yourtype
13 type :: mytype
14 integer, dimension(2) :: myi = (/800,900/)
15 real, dimension(2) :: myx = (/8000.,9000./)
16 character(len=2) :: mych = "zz"
17 type(yourtype) :: my_yourtype
18 end type mytype
20 type(mytype) :: z
21 integer :: ier
22 integer :: zeros(10)
23 namelist /mynml/ zeros, z
25 zeros = 0
26 zeros(5) = 1
28 open(10,status="scratch", delim="apostrophe")
29 write (10, nml=mynml, iostat=ier)
30 if (ier.ne.0) call abort
32 rewind (10)
33 read (10, NML=mynml, IOSTAT=ier)
34 if (ier.ne.0) call abort
35 close (10)
37 end program namelist_13