Once or twice a year some regression results from changed I/O
in libgfortran, such that some existing test-case starts
calling libgfortran/io/unix.c:raw_truncate, which on
limited-I/O-bare-iron targets will emit "required ftruncate or
chsize support not present" and fail.  After a while, I get to
it and commit a patch such as the following, updating the
regressing tests and new ones I spot in gfortran.log with the
self-marked line above.  This time, it happened in 173155:173168.

Usually, there's also a brief question whether all changes were
intended, or perhaps that some of the regressing tests (here:
gfortran.dg/fmt_cache_1.f and gfortran.dg/ftell_3.f90) were not
really supposed to have raw_truncate called.  So, should they?

Two of the test-cases, gfortran.dg/endfile_3.f90 and
gfortran.dg/endfile_4.f90 actually pass, which seems wrong, as
raw_truncate after emitting the error message returns an error
indication (so, the test-program should abort or return an error
AFAICT).  Perhaps due to lack of error handling in the
call-chain to raw_truncate?

Anyway, committed as obvious.  See also
<http://gcc.gnu.org/ml/fortran/2009-07/msg00095.html>.

gcc/testsuite:
        * gfortran.dg/pr47878.f90, gfortran.dg/endfile_3.f90,
        gfortran.dg/endfile_4.f90, gfortran.dg/ftell_3.f90,
        gfortran.dg/fmt_cache_1.f, gfortran.dg/namelist_66.f90:
        Gate test on effective_target fd_truncate.

Index: gfortran.dg/endfile_4.f90
===================================================================
--- gfortran.dg/endfile_4.f90   (revision 173380)
+++ gfortran.dg/endfile_4.f90   (working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! pr44477 ENDFILE not allowed after ENDFILE
 !-------------------------------------------
   open(10, form='formatted', &
Index: gfortran.dg/pr47878.f90
===================================================================
--- gfortran.dg/pr47878.f90     (revision 173380)
+++ gfortran.dg/pr47878.f90     (working copy)
@@ -1,5 +1,5 @@
 ! PR fortran/47878
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
   integer :: a(5)
   open (99, recl = 40)
   write (99, '(5i3)') 1, 2, 3
Index: gfortran.dg/namelist_66.f90
===================================================================
--- gfortran.dg/namelist_66.f90 (revision 173380)
+++ gfortran.dg/namelist_66.f90 (working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR46010 Failure to read these two examples of namelists
 type ptracer
    character(len = 2)  :: sname
Index: gfortran.dg/ftell_3.f90
===================================================================
--- gfortran.dg/ftell_3.f90     (revision 173380)
+++ gfortran.dg/ftell_3.f90     (working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR43605 FTELL intrinsic returns incorrect position
 ! Contributed by Janne Blomqvist, Manfred Schwarb
 ! and Dominique d'Humieres.
Index: gfortran.dg/endfile_3.f90
===================================================================
--- gfortran.dg/endfile_3.f90   (revision 173380)
+++ gfortran.dg/endfile_3.f90   (working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! pr44477 READ/WRITE not allowed after ENDFILE 
 !-------------------------------------------
   open(10, form='formatted', &
Index: gfortran.dg/fmt_cache_1.f
===================================================================
--- gfortran.dg/fmt_cache_1.f   (revision 173380)
+++ gfortran.dg/fmt_cache_1.f   (working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! pr40662 segfaults when specific format is invoked twice.
 ! pr40330  incorrect io.
 ! test case derived from pr40662, <jvdeli...@gcc.gnu.org>

brgds, H-P

Reply via email to