summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/read_empty_file.f
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/read_empty_file.f')
-rw-r--r--gcc/testsuite/gfortran.dg/read_empty_file.f7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/read_empty_file.f b/gcc/testsuite/gfortran.dg/read_empty_file.f
new file mode 100644
index 00000000000..d4077481bda
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/read_empty_file.f
@@ -0,0 +1,7 @@
+! { dg-do run }
+! PR43320 Missing EOF on read from empty file.
+ open(8,status='scratch',form='formatted') ! Create empty file
+ read(8,'(a80)', end=123) ! Reading from an empty file should be an EOF
+ call abort
+123 continue
+ end