diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/io.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/io_constraints_2.f90 | 3 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/namelist_internal.f90 | 21 |
5 files changed, 43 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 8ff4a5f..e5540e0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2006-10-28 Tobias Burnus <burnus@net-b.de> + + PR fortran/28224 + * io.c (check_io_constraints): Allow namelists + for internal files for Fortran 2003. + 2006-10-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/27954 diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index d489769..cbb7cf9 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -2596,9 +2596,13 @@ if (condition) \ "REC tag at %L is incompatible with internal file", &dt->rec->where); - io_constraint (dt->namelist != NULL, - "Internal file at %L is incompatible with namelist", - &expr->where); + if (dt->namelist != NULL) + { + if (gfc_notify_std(GFC_STD_F2003, + "Internal file at %L is incompatible with namelist", + &expr->where) == FAILURE) + m = MATCH_ERROR; + } io_constraint (dt->advance != NULL, "ADVANCE tag at %L is incompatible with internal file", diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e93c338..ca0f312 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,10 @@ -2006-10-28 Tobias Burnus <burnus@net-b.de> +2006-10-28 Tobias Burnus <burnus@net-b.de> + + PR fortran/28224 + * gfortran.dg/io_constraints_2.f90: Use -std=f95. + * gfortran.dg/namelist_internal.f90: New test. + +2006-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/29625 * gfortran.dg/io_real_boz.f90: Add. diff --git a/gcc/testsuite/gfortran.dg/io_constraints_2.f90 b/gcc/testsuite/gfortran.dg/io_constraints_2.f90 index c2a49e2..0b2c204 100644 --- a/gcc/testsuite/gfortran.dg/io_constraints_2.f90 +++ b/gcc/testsuite/gfortran.dg/io_constraints_2.f90 @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=f95" } ! Part II of the test of the IO constraints patch, which fixes PRs: ! PRs 25053, 25063, 25064, 25066, 25067, 25068, 25069, 25307 and 20862. ! Modified2006-07-08 to check the patch for PR20844. @@ -35,7 +36,7 @@ end module global write(*, NML=NL) z ! { dg-error "followed by IO-list" } !Was correctly picked up before patch. - print NL, z ! { dg-error "followed by IO-list" } + print NL, z ! { dg-error "PRINT namelist at \\(1\\) is an extension" } ! ! Not allowed with internal unit !Was correctly picked up before patch. diff --git a/gcc/testsuite/gfortran.dg/namelist_internal.f90 b/gcc/testsuite/gfortran.dg/namelist_internal.f90 new file mode 100644 index 0000000..4f8aeb2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_internal.f90 @@ -0,0 +1,21 @@ +! { dg-do run } +! { dg-options "-fall-intrinsics -std=f2003" } +! Checks internal file read/write of namelists +! (Fortran 2003 feature) +! PR fortran/28224 +program nml_internal + integer :: i, j + real :: r + namelist /nam/ i, j, r + character(len=250) :: str + + i = 42 + j = -718 + r = exp(1.0) + write(str,nml=nam) + i = -33 + j = 10 + r = sin(1.0) + read(str,nml=nam) + if(i /= 42 .or. j /= -718 .or. abs(r-exp(1.0)) > 1e-5) call abort() +end program nml_internal |