1! { dg-do run }
2! PR36582 Namelist I/O error: Bogus "Cannot match namelist object"
3! Test case derived from PR.
4module mod1
5
6type screen_io_type
7integer :: begin
8end type screen_io_type
9
10type adjoint_type
11type(screen_io_type) :: screen_io_fs_ntime
12character(12) :: solver_type
13end type adjoint_type
14
15type(adjoint_type) :: adjoint
16namelist/info_adjoint/adjoint
17
18end module mod1
19
20program gfortran_error_2
21use mod1
22adjoint%solver_type = "abcdefghijkl"
23open(31,status='scratch')
24write(31, '(a)') "&info_adjoint"
25write(31, '(a)') "adjoint%solver_type = 'direct'"
26write(31, '(a)') "adjoint%screen_io_fs_ntime%begin = 42"
27write(31, '(a)') "/"
28rewind(31)
29read(31,nml=info_adjoint)
30if (adjoint%solver_type /= 'direct') call abort
31if (adjoint%screen_io_fs_ntime%begin /= 42) call abort
32end program gfortran_error_2
33