2 ! { dg-options "-std=f95" }
3 ! Part II of the test of the IO constraints patch, which fixes PRs:
4 ! PRs 25053, 25063, 25064, 25066, 25067, 25068, 25069, 25307 and 20862.
5 ! Modified2006-07-08 to check the patch for PR20844.
7 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
20 100 format (1h
, "i=", i6
) ! { dg-warning "H format specifier" }
28 character(80) :: buffer(3)
31 ! Appending to a USE associated namelist is an extension.
33 NAMELIST /NL
/ a
,b
! { dg-warning "already is USE associated" }
37 write(*, NML
=NL
) z
! { dg-error "followed by IO-list" }
38 !Was correctly picked up before patch.
39 print NL
, z
! { dg-error "PRINT namelist at \\(1\\) is an extension" }
41 ! Not allowed with internal unit
42 !Was correctly picked up before patch.
43 write(buffer
, NML
=NL
) ! { dg-error "Internal file at \\(1\\) with namelist" }
44 !Was correctly picked up before patch.
45 write(buffer
, fmt
='(i6)', REC
=10) a
! { dg-error "REC tag" }
46 write(buffer
, fmt
='(i6)', END=10) a
! { dg-error "END tag" }
48 ! Not allowed with REC= specifier
49 !Was correctly picked up before patch.
50 read(10, REC
=10, END=100) ! { dg-error "END tag is not allowed" }
51 write(*, *, REC
=10) ! { dg-error "FMT=" }
53 ! Not allowed with an ADVANCE=specifier
54 READ(buffer
, fmt
='(i6)', advance
='YES') a
! { dg-error "internal file" }
55 READ(1, NML
=NL
, advance
='YES') ! { dg-error "NAMELIST IO is not allowed" }
57 READ(1, fmt
='(i6)', advance
='NO', size
= ierr
) ! { dg-error "requires default INTEGER" }
59 READ(1, advance
='YES') ! { dg-error "must appear with an explicit format" }
61 write(1, fmt
='(i6)', advance
='YES', size
= c(1)) a
! { dg-error "output" }
62 write(1, fmt
='(i6)', advance
='YES', eor
= 100) a
! { dg-error "output" }
64 read(1, fmt
='(i6)', advance
='YES', size
= c(1)) a
! { dg-error "ADVANCE = 'NO'" }
65 read(1, fmt
='(i6)', advance
='YES', eor
= 100) a
! { dg-error "ADVANCE = 'NO'" }
67 READ(1, fmt
='(i6)', advance
='NO', size
= buffer
) a
! { dg-error "INTEGER" }
68 !Was correctly picked up before patch. -correct syntax error
69 READ(1, fmt
='(i6)', advance
='YES', size
= 10) a
! { dg-error "Invalid value for SIZE specification" }
71 READ(1, fmt
='(i6)', advance
='MAYBE') ! { dg-error "YES or NO" }
77 ! { dg-final { cleanup-modules "global" } }