re PR fortran/67367 (Program crashes on READ(IOSTAT=IOS, ...) on directory OPEN(...
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 29 Aug 2015 15:52:43 +0000 (15:52 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 29 Aug 2015 15:52:43 +0000 (15:52 +0000)
2015-08-29 Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/67367
* gfortran.dg/read_dir.f90: New test. May fail on some platforms.

From-SVN: r227321

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/read_dir.f90 [new file with mode: 0644]

index 08e4083123867623bacc074a4c58e703a263465a..1d8373d78766b81274cc2525d8422f72b4ba9cf8 100644 (file)
@@ -1,3 +1,8 @@
+2015-08-29 Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/67367
+       * gfortran.dg/read_dir.f90: New test. May fail on some platforms.
+
 2015-08-29  Tom de Vries  <tom@codesourcery.com>
 
        PR tree-optimization/46193
diff --git a/gcc/testsuite/gfortran.dg/read_dir.f90 b/gcc/testsuite/gfortran.dg/read_dir.f90
new file mode 100644 (file)
index 0000000..f19740c
--- /dev/null
@@ -0,0 +1,14 @@
+! { dg-do run }
+! PR67367
+program bug
+   implicit none
+   character(len=1) :: c
+   character(len=256) :: message
+   integer ios
+   call system('[ -d junko.dir ] || mkdir junko.dir')
+   open(unit=10, file='junko.dir',iostat=ios,action='read',access='stream')
+   if (ios.ne.0) call abort
+   read(10, iostat=ios) c
+   if (ios.ne.21) call abort
+   call system('rmdir junko.dir')
+end program bug