summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/streamio_13.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/streamio_13.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/streamio_13.f9015
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/streamio_13.f90 b/gcc/testsuite/gfortran.dg/streamio_13.f90
new file mode 100644
index 000000000..e37535b7b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/streamio_13.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+! PR 34405 - BACKSPACE for unformatted stream files is prohibited.
+program main
+ implicit none
+ integer :: ios
+ character(len=80) :: msg
+ open(2003,form="unformatted",access="stream",status="scratch")
+ write (2003) 1
+ write (2003) 2
+ ios = 0
+ msg = ' '
+ backspace (2003,iostat=ios,iomsg=msg)
+ if (ios == 0 .or. msg /="Cannot BACKSPACE an unformatted stream file") &
+ call abort
+end program main