From: Jerry DeLisle Date: Thu, 15 Jan 2015 04:06:02 +0000 (+0000) Subject: re PR fortran/61933 (Inquire on internal units) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1a0c69834516bf7731d34aa47febea6850ed773f;p=gcc.git re PR fortran/61933 (Inquire on internal units) 2015-01-14 Jerry DeLisle PR target/61933 * gfortran.dg/inquire_internal.f90: New. * gfortran.dg/negative_unit_check.f90: New. From-SVN: r219632 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cfbbde81847..4be48a15f21 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-01-14 Jerry DeLisle + + PR target/61933 + * gfortran.dg/inquire_internal.f90: New. + * gfortran.dg/negative_unit_check.f90: New. + 2015-01-14 Oleg Endo PR target/53988 diff --git a/gcc/testsuite/gfortran.dg/inquire_internal.f90 b/gcc/testsuite/gfortran.dg/inquire_internal.f90 new file mode 100644 index 00000000000..26570e6e43e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/inquire_internal.f90 @@ -0,0 +1,15 @@ +! { dg-do run } +! Test case from PR61933. + use iso_fortran_env + logical :: unit_exists + integer :: tunit, istat + istat = 0 + tunit=-1 ! Represents an internal unit. + unit_exists = .true. + inquire(unit=tunit, exist=unit_exists, iostat=istat) + !print *, "Error Code is : ", IOSTAT_INQUIRE_INTERNAL_UNIT + !print *, "IOSTAT Code is: ", istat + !print *, tunit, unit_exists + if (istat.ne.iostat_inquire_internal_unit) call abort() + if (unit_exists) call abort() +END diff --git a/gcc/testsuite/gfortran.dg/negative_unit_check.f90 b/gcc/testsuite/gfortran.dg/negative_unit_check.f90 new file mode 100644 index 00000000000..2a1b16c1093 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/negative_unit_check.f90 @@ -0,0 +1,5 @@ +! { dg-do compile } +! Test case from PR61933. + LOGICAL :: file_exists + INQUIRE(UNIT=-1,EXIST=file_exists)! { dg-error "can not be -1" } +END