io_constraints_1.f90
来自「用于进行gcc测试」· F90 代码 · 共 81 行
F90
81 行
! { dg-do compile }! { dg-options "-std=f95" }! Part I of the test of the IO constraints patch, which fixes PRs:! PRs 25053, 25063, 25064, 25066, 25067, 25068, 25069, 25307 and 20862.!! Contributed by Paul Thomas <pault@gcc.gnu.org>!module fails 2000 format (1h , 2i6) ! { dg-error "Format statement in module" }end module failsmodule global integer :: modvar namelist /NL/ modvarcontains subroutine foo (i) integer :: i write (*, 100) i 100 format (1h , "i=", i6) ! { dg-warning "The H format specifier at ... is a Fortran 95 deleted feature" } end subroutine fooend module global use global integer :: a,b, c(20) integer(8) :: ierr character*80 :: buffer(3)! Appending to a USE associated namelist is an extension. NAMELIST /NL/ a,b ! { dg-warning "already is USE associated" } a=1 ; b=2!9.2.2.1: write(c, *) a, b ! { dg-error "array" }!Was correctly picked up before patch. write(buffer((/3,1,2/)), *) a, b ! { dg-error "vector subscript" }!9.2.2.2 and one of 9.4.1!________________________ write(6, NML=NL, FMT = '(i6)') ! { dg-error "group name and format" } write(6, NML=NL, FMT = 200) ! { dg-error "group name and format" }!9.4.1!_____!! R912!Was correctly picked up before patch. write(6, NML=NL, iostat = ierr) ! { dg-warning "requires default INTEGER" }! Constraints!Was correctly picked up before patch. write(1, fmt='(i6)', end = 100) a ! { dg-error "END tag" }!Was correctly picked up before patch. write(1, fmt='(i6)', eor = 100) a ! { dg-error "EOR tag" }!Was correctly picked up before patch. write(1, fmt='(i6)', size = b) a ! { dg-error "SIZE=specifier not allowed" } READ(1, fmt='(i6)', end = 900) a ! { dg-error "not defined" } READ(1, fmt='(i6)', eor = 900, advance='NO') a ! { dg-error "not defined" } READ(1, fmt='(i6)', ERR = 900) a ! { dg-error "not defined" }!Was correctly picked up before patch. READ(1, fmt=800) a ! { dg-error "not defined" }100 continue200 format (2i6) END! { dg-final { cleanup-modules "fails global" } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?