PR ipa/83051
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_64.f90
blobb5084e0f63c04ba22a9b5ed20f4df33c16540fe0
1 ! { dg-do run }
2 ! PR45532 gfortran namelist read error.
3 ! Derived from the original test case by David Sagan.
4 program test
5 implicit none
6 type line_struct
7 integer :: width = 10
8 end type
9 type symbol_struct
10 integer :: typee = 313233
11 end type
12 type curve_struct
13 type (line_struct) line
14 type (symbol_struct) symbol
15 end type
16 type (curve_struct) curve(10)
17 namelist / params / curve
19 open (10, status="scratch")
20 write(10,*) "&params"
21 write(10,*) " curve(1)%symbol%typee = 1234"
22 write(10,*) "/"
23 rewind(10)
24 read (10, nml = params)
25 if (curve(1)%symbol%typee /= 1234) call abort
26 close(10)
27 end program