diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2006-10-18 04:08:30 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2006-10-18 04:08:30 +0000 |
commit | 94d3995aa3649d777794b8a70c9b8ea21bdfdd04 (patch) | |
tree | 82bc051e27bedb032c5a3c78af5b7d72a670086f /gcc | |
parent | 09861cbee63a833e24b235a82432f2086f993624 (diff) | |
download | gcc-94d3995aa3649d777794b8a70c9b8ea21bdfdd04.zip gcc-94d3995aa3649d777794b8a70c9b8ea21bdfdd04.tar.gz gcc-94d3995aa3649d777794b8a70c9b8ea21bdfdd04.tar.bz2 |
re PR fortran/29277 (Formated stream output: Translate "\n" / achar(10) into "\r\n" on some platforms)
2006-10-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/29277
* gfortran.dg/streamio_4.f90: Update test.
* gfortran.dg/streamio_11.f90: New test.
From-SVN: r117847
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/streamio_11.f90 | 43 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/streamio_4.f90 | 4 |
3 files changed, 49 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8e0c054..5080ad4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2006-10-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/29277 + * gfortran.dg/streamio_4.f90: Update test. + * gfortran.dg/streamio_11.f90: New test. + 2006-10-17 Lee Millward <lee.millward@codesuorcery.com> PR c++/27952 diff --git a/gcc/testsuite/gfortran.dg/streamio_11.f90 b/gcc/testsuite/gfortran.dg/streamio_11.f90 new file mode 100644 index 0000000..2084a23 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/streamio_11.f90 @@ -0,0 +1,43 @@ +! { dg-do run } +! PR29277 Stream IO test 11, tests formatted form. +! Contributed by Tobias Burnas. +program stream_test + implicit none + character(len=*), parameter :: rec1 = 'record1' + character(len=*), parameter :: rec2 = 'record2' + character(len=50) :: str1,str2 + integer :: len, i + real :: r + + open(10,form='formatted',access='stream',& + status='scratch',position='rewind') + write(10,'(a)') rec1//new_line('a')//rec2 + rewind(10) + read(10,*) str1 + read(10,*) str2 + if(str1 /= rec1 .or. str2 /= rec2) call abort() + rewind(10) + read(10,'(a)') str1 + read(10,'(a)') str2 + if(str1 /= rec1 .or. str2 /= rec2) call abort() + close(10) + + open(10,form='formatted',access='stream',& + status='scratch',position='rewind') + write(10,*) '123 '//trim(rec1)//' 1e-12' + write(10,*) '12345.6789' + rewind(10) + read(10,*) i,str1 + read(10,*) r + if(i /= 123 .or. str1 /= rec1 .or. r /= 12345.6789) & + call abort() + close(10) + + open(unit=10,form='unformatted',access='stream', & + status='scratch',position='rewind') + write(10) rec1//new_line('a')//rec2 + len = len_trim(rec1//new_line('a')//rec2) + rewind(10) + read(10) str1(1:len) + if(str1 /= rec1//new_line('a')//rec2) call abort() +end program stream_test diff --git a/gcc/testsuite/gfortran.dg/streamio_4.f90 b/gcc/testsuite/gfortran.dg/streamio_4.f90 index 871bafe..64d2f52 100644 --- a/gcc/testsuite/gfortran.dg/streamio_4.f90 +++ b/gcc/testsuite/gfortran.dg/streamio_4.f90 @@ -15,7 +15,6 @@ program streamtest do j=0,9 write(10,"(i5)") j end do - write(10,"(a)") lf end do close(10) @@ -26,7 +25,6 @@ program streamtest do j=0,9 write(10,"(i5)") j end do - write(10,"(a)") lf end do rewind(10) do i=1,lines @@ -34,8 +32,6 @@ program streamtest read(10,"(i5)") k if (k.ne.j) call abort() end do - read(10,"(a)") tchar - if (tchar.ne.lf) call abort() end do close(10,status="delete") |