5 character(len
=2) :: c012345678901234567890123456789012345678901234567890123456789h(2) = (/"aa","bb"/)
8 integer :: i(2) = (/1,2/)
16 character(140) :: teststring
19 teststring
= " x(2)%m%c012345678901234567890123456789012345678901234567890123456789h(:)(2:2) = 'z','z',"
20 call writenml (teststring
)
21 teststring
= " x(2)%m(2)%c012345678901234567890123456789012345678901234567890123456789h(:)(2) = 'z','z',"
22 call writenml (teststring
)
23 teststring
= " x(2)%m(2)%c012345678901234567890123456789012345678901234567890123456789h(:)(:3) = 'z','z',"
24 call writenml (teststring
)
25 teststring
= " x(2)%m(2)%c012345678901234567890123456789012345678901234567890123456789h(1:2)(k:) = 'z','z',"
26 call writenml (teststring
)
30 subroutine writenml (astring
)
31 character(140), intent(in
) :: astring
32 character(300) :: errmessage
35 open (10, status
="scratch", delim
='apostrophe')
36 write (10, '(A)') "&MYNML"
37 write (10, '(A)') astring
40 read (10, nml
= mynml
, iostat
=ierror
, iomsg
=errmessage
)
41 if (ierror
== 0) STOP 1
42 print '(a)', trim(errmessage
)
45 end subroutine writenml
47 end program namelist_47
48 ! { dg-output "Multiple sub-objects with non-zero rank in namelist object x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" }
49 ! { dg-output "Missing colon in substring qualifier for namelist variable x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" }
50 ! { dg-output "Substring out of range for namelist variable x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" }
51 ! { dg-output "Bad character in substring qualifier for namelist variable x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" }