This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA:] PR35293 and testsuite: don't run tests using truncation on targets without support


Here's the part of PR libfortran/35293 that stops targets without
truncation supports from running such tests.  The test-cases are
semi-automatically edited from the truncation-specific failure messages
from cris-axis-linux-gnu (simulator complaining about lack of support at
the ftruncate64 syscall) and verified by regtesting for arm-elf and
cris-elf.  No regressions for x86_64-unknown-linux-gnu and removes the old
and new (from previous patch) regressions for cris-elf and
cris-axis-linux-gnu.  I checked that a simulator (i.e. not just a native
target) *with* ftruncate support would be flagged as having ftruncate
support by instrumenting enough to see cris-axis-linux-gnu pass
(i.e. using ftruncate rather than ftruncate64).

The feature name fd_truncate was chosen as not being the name of a syscall
or libc function but being the name of the function in
libgfortran/io/unix.c that's responsible for file truncation, using either
chsize or ftruncate as available (see previous message).  It needs to be a
run-test rather than a link-test, as I can imagine (no promise on being
instrumental) in adding stub support for ftruncate to newlib, which would
cause a link-test to pass but the tests still fail.

An alternative would be to not build fortran or run the testsuite at all
for such targets, which might seem easier, but I recall finding one or two
target-related-fortran bugs by running the gfortran testsuite, so I'd like
to keep it running and to avoid the noise from tests with truncation.  If
you worry about the maintenance burden, I plan to commit as obvious
henceforth adding fd_truncate gates as necessary whenever I see a new
failure or regression where gfortran.log shows a "Fortran runtime error:
required ftruncate or chsize support not present"; not very hard and
either way nobody worried about these failures for newlib targets before
so it's no big deal if they aren't fixed on commit for new tests.

gcc/testsuite:
	* lib/lib/target-supports.exp (check_effective_target_fd_truncate):
	New.
	* gfortran.fortran-torture/execute/list_read_1.x,
	gfortran.fortran-torture/execute/read_null_string.x,
	gfortran.fortran-torture/execute/backspace.x,
	gfortran.fortran-torture/execute/seq_io.x,
	gfortran.fortran-torture/execute/slash_edit.x,
	gfortran.fortran-torture/execute/unopened_unit_1.x,
	gfortran.dg/namelist_21.f90, gfortran.dg/advance_5.f90,
	gfortran.dg/fmt_t_7.f, gfortran.dg/eor_1.f90, 
	gfortran.dg/read_x_past.f, gfortran.dg/tl_editing.f90,
	gfortran.dg/ftell_2.f90, gfortran.dg/namelist_13.f90,
	gfortran.dg/namelist_22.f90, gfortran.dg/advance_6.f90,
	gfortran.dg/read_bad_advance.f90, gfortran.dg/func_derived_3.f90,
	gfortran.dg/namelist_40.f90, gfortran.dg/x_slash_2.f,
	gfortran.dg/namelist_14.f90, gfortran.dg/backspace_1.f,
	gfortran.dg/namelist_23.f90, gfortran.dg/pr17285.f90,
	gfortran.dg/read_noadvance.f90, gfortran.dg/namelist_use_only.f90,
	gfortran.dg/namelist_41.f90, gfortran.dg/namelist_15.f90,
	gfortran.dg/backspace_3.f, gfortran.dg/backslash_3.f,
	gfortran.dg/namelist_24.f90, gfortran.dg/pr17286.f90,
	gfortran.dg/endfile.f90, gfortran.dg/open_access_append_1.f90,
	gfortran.dg/fmt_huge.f90, gfortran.dg/namelist_42.f90,
	gfortran.dg/pr18392.f90, gfortran.dg/pr19155.f, gfortran.dg/pr12884.f,
	gfortran.dg/namelist_16.f90, gfortran.dg/backspace_5.f,
	gfortran.dg/open_readonly_1.f90, gfortran.dg/fmt_read.f90,
	gfortran.dg/iostat_1.f90, gfortran.dg/namelist_43.f90,
	gfortran.dg/read_size_noadvance.f90, gfortran.dg/inquire_5.f90,
	gfortran.dg/read_many_1.f, gfortran.dg/namelist_17.f90,
	gfortran.dg/list_read_1.f90, gfortran.dg/backspace_10.f90,
	gfortran.dg/namelist_26.f90, gfortran.dg/unf_read_corrupted_2.f90,
	gfortran.dg/record_marker_1.f90, gfortran.dg/convert_implied_open.f90,
	gfortran.dg/iostat_2.f90, gfortran.dg/write_check3.f90,
	gfortran.dg/namelist_44.f90, gfortran.dg/namelist_use.f90,
	gfortran.dg/rewind_1.f90, gfortran.dg/streamio_11.f90,
	gfortran.dg/namelist_18.f90, gfortran.dg/backspace_9.f,
	gfortran.dg/dos_eol.f, gfortran.dg/read_eof_1.f90,
	gfortran.dg/namelist_27.f90, gfortran.dg/pad_no.f90,
	gfortran.dg/endfile.f, gfortran.dg/namelist_11.f,
	gfortran.dg/namelist_19.f90, gfortran.dg/eor_handling_1.f90,
	gfortran.dg/write_rewind_1.f, gfortran.dg/comma.f,
	gfortran.dg/read_eof_2.f90, gfortran.dg/namelist_28.f90,
	gfortran.dg/record_marker_3.f90, gfortran.dg/complex_read.f90,
	gfortran.dg/namelist_37.f90, gfortran.dg/error_recovery_5.f90,
	gfortran.dg/namelist_char_only.f90, gfortran.dg/pr18122.f90,
	gfortran.dg/list_read_4.f90, gfortran.dg/eor_handling_2.f90,
	gfortran.dg/read_eof_3.f90, gfortran.dg/dollar_edit_descriptor_1.f,
	gfortran.dg/pr19467.f90, gfortran.dg/namelist_38.f90,
	gfortran.dg/inquire_9.f90, gfortran.dg/list_read_5.f90,
	gfortran.dg/noadv_size.f90, gfortran.dg/backslash_1.f90,
	gfortran.dg/eor_handling_3.f90, gfortran.dg/read_eof_4.f90,
	gfortran.dg/runtime_warning_1.f90, gfortran.dg/x_slash_1.f,
	gfortran.dg/namelist_39.f90, gfortran.dg/streamio_3.f90,
	gfortran.dg/read_comma.f, gfortran.dg/pr19657.f,
	gfortran.dg/streamio_15.f90, gfortran.dg/list_read_6.f90,
	gfortran.dg/eor_handling_4.f90, gfortran.dg/backslash_2.f90,
	gfortran.dg/pr19216.f, gfortran.dg/PR19872.f,
	gfortran.dg/backspace_2.f, gfortran.dg/empty_format_1.f90,
	gfortran.dg/streamio_4.f90, gfortran.dg/append_1.f90,
	gfortran.dg/fgetc_1.f90, gfortran.dg/complex_write.f90,
	gfortran.dg/list_read_7.f90, gfortran.dg/eor_handling_5.f90,
	gfortran.dg/fmt_t_1.f90, gfortran.dg/pr17090.f90,
	gfortran.dg/backspace_4.f, gfortran.dg/shape_3.f90,
	gfortran.dg/unf_io_convert_1.f90, gfortran.dg/fgetc_2.f90,
	gfortran.dg/vector_subscript_3.f90, gfortran.dg/list_read_8.f90,
	gfortran.dg/flush_1.f90, gfortran.dg/advance_1.f90,
	gfortran.dg/fmt_t_2.f90, gfortran.dg/backspace_6.f,
	gfortran.dg/slash_1.f90, gfortran.dg/stat_1.f90,
	gfortran.dg/unformatted_recl_1.f90, gfortran.dg/record_marker_2.f,
	gfortran.dg/overwrite_1.f, gfortran.dg/unf_io_convert_2.f90,
	gfortran.dg/fmt_t_3.f90, gfortran.dg/backspace_8.f,
	gfortran.dg/stat_2.f90, gfortran.dg/pr18210.f90,
	gfortran.dg/unformatted_subrecord_1.f90, gfortran.dg/pr20257.f90,
	gfortran.dg/eof_1.f90, gfortran.dg/fmt_t_4.f90,
	gfortran.dg/unf_short_record_1.f90, gfortran.dg/fmt_exhaust.f90,
	gfortran.dg/namelist_20.f90, gfortran.dg/advance_4.f90,
	gfortran.dg/fmt_t_5.f90, gfortran.dg/namelist_12.f,
	gfortran.dg/backspace_7.f90, gfortran.dg/write_rewind_2.f,
	gfortran.dg/ftell_1.f90, gfortran.dg/fseek.f90,
	gfortran.dg/write_back.f: Gate test on effective_target
	fd_truncate.

Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 132670)
+++ lib/target-supports.exp	(working copy)
@@ -2227,6 +2227,45 @@
     }]
 }
 
+# Return 1 if the target can truncate a file from a file-descriptor,
+# as used by libgfortran/io/unix.c:fd_truncate; i.e. ftruncate or
+# chsize.  We test for a trivially functional truncation; no stubs.
+# As libgfortran uses _FILE_OFFSET_BITS 64, we do too; it'll cause a
+# different function to be used.
+
+proc check_effective_target_fd_truncate { } {
+    set prog {
+	#define _FILE_OFFSET_BITS 64
+	#include <unistd.h>
+	#include <stdio.h>
+	#include <stdlib.h>
+	int main ()
+	{
+	  FILE *f = fopen ("tst.tmp", "wb");
+	  int fd;
+	  const char t[] = "test writing more than ten characters";
+	  char s[11];
+	  fd =  fileno (f);
+	  write (fd, t, sizeof (t) - 1);
+	  lseek (fd, 0, 0);
+	  if (ftruncate (fd, 10) != 0)
+	    exit (1);
+	  close (fd);
+	  f = fopen ("tst.tmp", "rb");
+	  if (fread (s, 1, sizeof (s), f) != 10 || strncmp (s, t, 10) != 0)
+	    exit (1);
+	  exit (0);
+	}
+    }
+
+    if { [check_runtime ftruncate $prog] } {
+      return 1;
+    }
+
+    regsub "ftruncate" $prog "chsize" prog
+    return [check_runtime chsize $prog]
+}
+
 # Add to FLAGS all the target-specific flags needed to access the c99 runtime.
 
 proc add_options_for_c99_runtime { flags } {
Index: gfortran.fortran-torture/execute/list_read_1.x
===================================================================
--- gfortran.fortran-torture/execute/list_read_1.x	(revision 0)
+++ gfortran.fortran-torture/execute/list_read_1.x	(revision 0)
@@ -0,0 +1,7 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_fd_truncate] } {
+	return 1
+}
+
+return 0
Index: gfortran.fortran-torture/execute/read_null_string.x
===================================================================
--- gfortran.fortran-torture/execute/read_null_string.x	(revision 0)
+++ gfortran.fortran-torture/execute/read_null_string.x	(revision 0)
@@ -0,0 +1,7 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_fd_truncate] } {
+	return 1
+}
+
+return 0
Index: gfortran.fortran-torture/execute/backspace.x
===================================================================
--- gfortran.fortran-torture/execute/backspace.x	(revision 0)
+++ gfortran.fortran-torture/execute/backspace.x	(revision 0)
@@ -0,0 +1,7 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_fd_truncate] } {
+	return 1
+}
+
+return 0
Index: gfortran.fortran-torture/execute/seq_io.x
===================================================================
--- gfortran.fortran-torture/execute/seq_io.x	(revision 0)
+++ gfortran.fortran-torture/execute/seq_io.x	(revision 0)
@@ -0,0 +1,7 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_fd_truncate] } {
+	return 1
+}
+
+return 0
Index: gfortran.fortran-torture/execute/slash_edit.x
===================================================================
--- gfortran.fortran-torture/execute/slash_edit.x	(revision 0)
+++ gfortran.fortran-torture/execute/slash_edit.x	(revision 0)
@@ -0,0 +1,7 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_fd_truncate] } {
+	return 1
+}
+
+return 0
Index: gfortran.fortran-torture/execute/unopened_unit_1.x
===================================================================
--- gfortran.fortran-torture/execute/unopened_unit_1.x	(revision 0)
+++ gfortran.fortran-torture/execute/unopened_unit_1.x	(revision 0)
@@ -0,0 +1,7 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_fd_truncate] } {
+	return 1
+}
+
+return 0
Index: gfortran.dg/namelist_21.f90
===================================================================
--- gfortran.dg/namelist_21.f90	(revision 132670)
+++ gfortran.dg/namelist_21.f90	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! Tests filling arrays from a namelist read when object list is not complete.
 ! Developed from a test case provided by Christoph Jacob.
 ! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org>.
Index: gfortran.dg/advance_5.f90
===================================================================
--- gfortran.dg/advance_5.f90	(revision 132670)
+++ gfortran.dg/advance_5.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR31207 Last record truncated for read after short write.
 character(len=20) :: b
 ! write something no advance
Index: gfortran.dg/fmt_t_7.f
===================================================================
--- gfortran.dg/fmt_t_7.f	(revision 132670)
+++ gfortran.dg/fmt_t_7.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR34974 null bytes when reverse-tabbing long records
 ! Test case prpared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
        program test
Index: gfortran.dg/eor_1.f90
===================================================================
--- gfortran.dg/eor_1.f90	(revision 132670)
+++ gfortran.dg/eor_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 19451: The test for advance='NO' with eor used to be reversed.
 program main
   character*2 c
Index: gfortran.dg/read_x_past.f
===================================================================
--- gfortran.dg/read_x_past.f	(revision 132670)
+++ gfortran.dg/read_x_past.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options -w }
 ! PR 26661 : Test reading X's past file end with no LF or CR.
 ! PR 26880 : Tests that rewind clears the gfc_unit read_bad flag.
Index: gfortran.dg/tl_editing.f90
===================================================================
--- gfortran.dg/tl_editing.f90	(revision 132670)
+++ gfortran.dg/tl_editing.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }     
+! { dg-do run { target fd_truncate } }     
 ! Test of fix to bug triggered by NIST fm908.for.
 ! Left tabbing, followed by X or T-tabbing to the right would
 ! cause spaces to be overwritten on output data.
Index: gfortran.dg/ftell_2.f90
===================================================================
--- gfortran.dg/ftell_2.f90	(revision 132670)
+++ gfortran.dg/ftell_2.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
   integer(kind=8) o
   open (10, status="scratch")
   if (ftell(10) /= 0) call abort
Index: gfortran.dg/namelist_13.f90
===================================================================
--- gfortran.dg/namelist_13.f90	(revision 132670)
+++ gfortran.dg/namelist_13.f90	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! Tests simple derived types.
 ! Provided by Paul Thomas - pault@gcc.gnu.org
 
Index: gfortran.dg/namelist_22.f90
===================================================================
--- gfortran.dg/namelist_22.f90	(revision 132670)
+++ gfortran.dg/namelist_22.f90	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! Tests filling arrays from a namelist read when object list is not complete.
 ! This is the same as namelist_21.f90 except using spaces as seperators instead
 ! of commas. Developed from a test case provided by Christoph Jacob.
Index: gfortran.dg/advance_6.f90
===================================================================
--- gfortran.dg/advance_6.f90	(revision 132670)
+++ gfortran.dg/advance_6.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 34370 - file positioning after non-advancing I/O didn't add
 ! a record marker.
 
Index: gfortran.dg/read_bad_advance.f90
===================================================================
--- gfortran.dg/read_bad_advance.f90	(revision 132670)
+++ gfortran.dg/read_bad_advance.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR27138 Failure to advance line on bad list directed read.
 ! Submitted by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
       program test
Index: gfortran.dg/func_derived_3.f90
===================================================================
--- gfortran.dg/func_derived_3.f90	(revision 132670)
+++ gfortran.dg/func_derived_3.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! This tests the "virtual fix" for PR19561, where pointers to derived
 ! types were not generating correct code.  This testcase is based on
 ! the original PR example.  This example not only tests the
Index: gfortran.dg/namelist_40.f90
===================================================================
--- gfortran.dg/namelist_40.f90	(revision 132670)
+++ gfortran.dg/namelist_40.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR33672 Additional runtime checks needed for namelist reads
 ! Submitted by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
Index: gfortran.dg/x_slash_2.f
===================================================================
--- gfortran.dg/x_slash_2.f	(revision 132670)
+++ gfortran.dg/x_slash_2.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 34887 - reverse tabs followed by a slash used to confuse I/O.
       program main
       character(len=2) :: b, a
Index: gfortran.dg/namelist_14.f90
===================================================================
--- gfortran.dg/namelist_14.f90	(revision 132670)
+++ gfortran.dg/namelist_14.f90	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! Tests various combinations of intrinsic types, derived types, arrays,
 ! dummy arguments and common to check nml_get_addr_expr in trans-io.c.
 ! See comments below for selection.
Index: gfortran.dg/backspace_1.f
===================================================================
--- gfortran.dg/backspace_1.f	(revision 132670)
+++ gfortran.dg/backspace_1.f	(working copy)
@@ -1,5 +1,5 @@
 ! This file is all about BACKSPACE
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 
       integer i, n, nr
       real x(10), y(10)
Index: gfortran.dg/namelist_23.f90
===================================================================
--- gfortran.dg/namelist_23.f90	(revision 132670)
+++ gfortran.dg/namelist_23.f90	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! PR26136 Filling logical variables from namelist read when object list is not
 ! complete.  Test case derived from PR.
 ! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
Index: gfortran.dg/pr17285.f90
===================================================================
--- gfortran.dg/pr17285.f90	(revision 132670)
+++ gfortran.dg/pr17285.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! pr 17285
 ! Test that namelist can read its own output.
 ! At the same time, check arrays and different terminations
Index: gfortran.dg/read_noadvance.f90
===================================================================
--- gfortran.dg/read_noadvance.f90	(revision 132670)
+++ gfortran.dg/read_noadvance.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! pr24719, non-advancing read should read more than one line
 ! test contributed by jerry delisle <jvdelisle@gcc.gnu.org>
       implicit none
Index: gfortran.dg/namelist_use_only.f90
===================================================================
--- gfortran.dg/namelist_use_only.f90	(revision 132670)
+++ gfortran.dg/namelist_use_only.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! This tests the fix for PR22010, where namelists were not being written to
 ! and read back from modules.  It checks that namelists from modules that are
 ! selected by an ONLY declaration work correctly, even when the variables in
Index: gfortran.dg/namelist_41.f90
===================================================================
--- gfortran.dg/namelist_41.f90	(revision 132670)
+++ gfortran.dg/namelist_41.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR34291 Segfault on &end in namelist expanded read of character
   implicit none
   character(len=10), dimension(2)  :: var
Index: gfortran.dg/namelist_15.f90
===================================================================
--- gfortran.dg/namelist_15.f90	(revision 132670)
+++ gfortran.dg/namelist_15.f90	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! Tests arrays of derived types containing derived type arrays whose
 ! components are character arrays - exercises object name parser in
 ! list_read.c. Checks that namelist output can be reread. 
Index: gfortran.dg/backspace_3.f
===================================================================
--- gfortran.dg/backspace_3.f	(revision 132670)
+++ gfortran.dg/backspace_3.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25598 Error on repeated backspaces.
 ! Derived from example given in PR by Dale Ranta
 ! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org> 
Index: gfortran.dg/backslash_3.f
===================================================================
--- gfortran.dg/backslash_3.f	(revision 132670)
+++ gfortran.dg/backslash_3.f	(working copy)
@@ -1,4 +1,4 @@
-C { dg-do run }
+C { dg-do run { target fd_truncate } }
 C { dg-options "-fbackslash" }
 C PR fortran/30278
       program a
Index: gfortran.dg/namelist_24.f90
===================================================================
--- gfortran.dg/namelist_24.f90	(revision 132670)
+++ gfortran.dg/namelist_24.f90	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 !{ dg-options -std=gnu }
 ! Tests namelist read when more data is provided then specified by 
 ! array qualifier in list.
Index: gfortran.dg/pr17286.f90
===================================================================
--- gfortran.dg/pr17286.f90	(revision 132670)
+++ gfortran.dg/pr17286.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR17286
 ! Namelist read failed when spaces exist between the '=' and the numbers
 ! This is a libgfortran bug
Index: gfortran.dg/endfile.f90
===================================================================
--- gfortran.dg/endfile.f90	(revision 132670)
+++ gfortran.dg/endfile.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run } 
+! { dg-do run { target fd_truncate } } 
 ! pr18364 endfile does not truncate file.
 !   write out 20 records
 !   rewind
Index: gfortran.dg/open_access_append_1.f90
===================================================================
--- gfortran.dg/open_access_append_1.f90	(revision 132670)
+++ gfortran.dg/open_access_append_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! Testcase for the GNU extension OPEN(...,ACCESS="APPEND")
   open (10,file="foo")
   close (10,status="delete")
Index: gfortran.dg/fmt_huge.f90
===================================================================
--- gfortran.dg/fmt_huge.f90	(revision 132670)
+++ gfortran.dg/fmt_huge.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR32446 printing big numbers in F0.1 format.
 ! This segfaulted before the patch.
       open (10, status="scratch")
Index: gfortran.dg/namelist_42.f90
===================================================================
--- gfortran.dg/namelist_42.f90	(revision 132670)
+++ gfortran.dg/namelist_42.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-mieee" { target sh*-*-* } }
 !
 ! PR fortran/34427
Index: gfortran.dg/pr18392.f90
===================================================================
--- gfortran.dg/pr18392.f90	(revision 132670)
+++ gfortran.dg/pr18392.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! pr 18392
 ! test namelist with derived types
 ! Based on example provided by thomas.koenig@online.de
Index: gfortran.dg/pr19155.f
===================================================================
--- gfortran.dg/pr19155.f	(revision 132670)
+++ gfortran.dg/pr19155.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 !
 ! PR libfortran/19155
 ! We accept 'E+00' as a valid real number. The standard says it is not,
Index: gfortran.dg/pr12884.f
===================================================================
--- gfortran.dg/pr12884.f	(revision 132670)
+++ gfortran.dg/pr12884.f	(working copy)
@@ -1,4 +1,4 @@
-c { dg-do run }
+c { dg-do run { target fd_truncate } }
 c pr 12884
 c test namelist with input file containg / before namelist. Also checks
 c non-standard use of $ instead of &
Index: gfortran.dg/namelist_16.f90
===================================================================
--- gfortran.dg/namelist_16.f90	(revision 132670)
+++ gfortran.dg/namelist_16.f90	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! Tests namelist on complex variables
 ! provided by Paul Thomas - pault@gcc.gnu.org
 program namelist_16
Index: gfortran.dg/backspace_5.f
===================================================================
--- gfortran.dg/backspace_5.f	(revision 132670)
+++ gfortran.dg/backspace_5.f	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! PR26464 File I/O error related to buffering and BACKSPACE
 ! Test case derived from case by Dale Ranta.
 ! Submitted  by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
Index: gfortran.dg/open_readonly_1.f90
===================================================================
--- gfortran.dg/open_readonly_1.f90	(revision 132670)
+++ gfortran.dg/open_readonly_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR19451
 ! Writing to a non-empty readonly file caused a segfault.
 ! We were still trying to write the EOR after an error ocurred
Index: gfortran.dg/fmt_read.f90
===================================================================
--- gfortran.dg/fmt_read.f90	(revision 132670)
+++ gfortran.dg/fmt_read.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! pr18398, missing data on sequential formatted reads
 ! test contributed by Thomas.Koenig@online.de
       open(7,status='scratch')
Index: gfortran.dg/iostat_1.f90
===================================================================
--- gfortran.dg/iostat_1.f90	(revision 132670)
+++ gfortran.dg/iostat_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 23598 - The iostat variable wasn't reset if the previous
 ! I/O library call had an error.
 program main
Index: gfortran.dg/namelist_43.f90
===================================================================
--- gfortran.dg/namelist_43.f90	(revision 132670)
+++ gfortran.dg/namelist_43.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-mieee" { target sh*-*-* } }
 !
 ! PR fortran/34427
Index: gfortran.dg/read_size_noadvance.f90
===================================================================
--- gfortran.dg/read_size_noadvance.f90	(revision 132670)
+++ gfortran.dg/read_size_noadvance.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR26890 Test for use of SIZE variable in IO list.
 ! Test case from Paul Thomas.
 ! Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
Index: gfortran.dg/inquire_5.f90
===================================================================
--- gfortran.dg/inquire_5.f90	(revision 132670)
+++ gfortran.dg/inquire_5.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! pr19314 inquire(..position=..) segfaults
 ! test by Thomas.Koenig@online.de
 !         bdavis9659@comcast.net
Index: gfortran.dg/read_many_1.f
===================================================================
--- gfortran.dg/read_many_1.f	(revision 132670)
+++ gfortran.dg/read_many_1.f	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! PR26423 Large file I/O error related to buffering
 ! Test case derived from case by Dale Ranta.
 ! Submitted  by Jerry DeLisle  <jvdelisle@gcc.gnu.org> 
Index: gfortran.dg/namelist_17.f90
===================================================================
--- gfortran.dg/namelist_17.f90	(revision 132670)
+++ gfortran.dg/namelist_17.f90	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! Tests namelist on logical variables
 ! provided by Paul Thomas - pault@gcc.gnu.org
 
Index: gfortran.dg/list_read_1.f90
===================================================================
--- gfortran.dg/list_read_1.f90	(revision 132670)
+++ gfortran.dg/list_read_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! Program to test terminators in list-directed input
 program list_read_1
   character(len=5) :: s
Index: gfortran.dg/backspace_10.f90
===================================================================
--- gfortran.dg/backspace_10.f90	(revision 132670)
+++ gfortran.dg/backspace_10.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR33307 I/O read/positioning problem - in BACKSPACE
 ! Test case devloped from test in PR by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 program gfcbug69b
Index: gfortran.dg/namelist_26.f90
===================================================================
--- gfortran.dg/namelist_26.f90	(revision 132670)
+++ gfortran.dg/namelist_26.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR30918 Failure to skip commented out NAMELIST
 ! Before the patch, this read the commented out namelist and iuse would
 ! equal 2 when done.  Test case from PR.
Index: gfortran.dg/unf_read_corrupted_2.f90
===================================================================
--- gfortran.dg/unf_read_corrupted_2.f90	(revision 132670)
+++ gfortran.dg/unf_read_corrupted_2.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR31880 silent data corruption in gfortran read statement
 ! Test from PR.
       program r3
Index: gfortran.dg/record_marker_1.f90
===================================================================
--- gfortran.dg/record_marker_1.f90	(revision 132670)
+++ gfortran.dg/record_marker_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-frecord-marker=4" }
 
 program main
Index: gfortran.dg/convert_implied_open.f90
===================================================================
--- gfortran.dg/convert_implied_open.f90	(revision 132670)
+++ gfortran.dg/convert_implied_open.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-fconvert=swap" }
 ! PR 26735 - implied open didn't use to honor -fconvert
 program main
Index: gfortran.dg/iostat_2.f90
===================================================================
--- gfortran.dg/iostat_2.f90	(revision 132670)
+++ gfortran.dg/iostat_2.f90	(working copy)
@@ -1,5 +1,5 @@
 ! PR libfortran/23784
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
   integer i
   close(10, status="whatever", iostat=i) ! { dg-warning "STATUS specifier in CLOSE statement.*has invalid value" }
   if (i == 0) call abort()
Index: gfortran.dg/write_check3.f90
===================================================================
--- gfortran.dg/write_check3.f90	(revision 132670)
+++ gfortran.dg/write_check3.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR29936 Missed constraint on RECL=specifier in unformatted sequential WRITE
 ! Submitted by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 program us_recl
Index: gfortran.dg/namelist_44.f90
===================================================================
--- gfortran.dg/namelist_44.f90	(revision 132670)
+++ gfortran.dg/namelist_44.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 !
 ! PR fortran/34530
 !
Index: gfortran.dg/namelist_use.f90
===================================================================
--- gfortran.dg/namelist_use.f90	(revision 132670)
+++ gfortran.dg/namelist_use.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! This tests the fix for PR22010, where namelists were not being written to
 ! and read back from modules.  It has two namelists: one that is USE
 ! associated and another that is concatenated by USE and host association.
Index: gfortran.dg/rewind_1.f90
===================================================================
--- gfortran.dg/rewind_1.f90	(revision 132670)
+++ gfortran.dg/rewind_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! Check that rewind doesn't delete a file.
 ! Writing to the file truncates it at the end of the current record.  Out
 ! IO library was defering the actual truncation until the file was rewound.
Index: gfortran.dg/streamio_11.f90
===================================================================
--- gfortran.dg/streamio_11.f90	(revision 132670)
+++ gfortran.dg/streamio_11.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR29277 Stream IO test 11, tests formatted form.
 ! Contributed by Tobias Burnas.
 program stream_test
Index: gfortran.dg/namelist_18.f90
===================================================================
--- gfortran.dg/namelist_18.f90	(revision 132670)
+++ gfortran.dg/namelist_18.f90	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! Tests character delimiters for namelist write 
 ! provided by Paul Thomas - pault@gcc.gnu.org
 
Index: gfortran.dg/backspace_9.f
===================================================================
--- gfortran.dg/backspace_9.f	(revision 132670)
+++ gfortran.dg/backspace_9.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR32235 incorrectly position text file after backspace
 ! Test case from PR, prepared by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
       program main
Index: gfortran.dg/dos_eol.f
===================================================================
--- gfortran.dg/dos_eol.f	(revision 132670)
+++ gfortran.dg/dos_eol.f	(working copy)
@@ -1,5 +1,5 @@
 ! PR libfortran/19678 and PR libfortran/19679
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
       integer i, j
       
       open (10,status='scratch')
Index: gfortran.dg/read_eof_1.f90
===================================================================
--- gfortran.dg/read_eof_1.f90	(revision 132670)
+++ gfortran.dg/read_eof_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25697 Check that reading from a file that is at end-of-file does not
 ! segfault or give error.  Test case derived from example in PR from Dale Ranta.
 ! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
Index: gfortran.dg/namelist_27.f90
===================================================================
--- gfortran.dg/namelist_27.f90	(revision 132670)
+++ gfortran.dg/namelist_27.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR31052 Bad IOSTAT values when readings NAMELISTs past EOF.
 ! Patch derived from PR, submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
 program gfcbug61
Index: gfortran.dg/pad_no.f90
===================================================================
--- gfortran.dg/pad_no.f90	(revision 132670)
+++ gfortran.dg/pad_no.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! Test correct operation for pad='no'.
 program main
   character(len=1) line(2)
Index: gfortran.dg/endfile.f
===================================================================
--- gfortran.dg/endfile.f	(revision 132670)
+++ gfortran.dg/endfile.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25550 file data corrupted after reading end of file.
 ! Derived from example given in PR from Dale Ranta.
 ! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org> 
Index: gfortran.dg/namelist_11.f
===================================================================
--- gfortran.dg/namelist_11.f	(revision 132670)
+++ gfortran.dg/namelist_11.f	(working copy)
@@ -1,4 +1,4 @@
-c { dg-do run }
+c { dg-do run { target fd_truncate } }
 c This program tests: namelist comment, a blank line before the nameilist name, the namelist name,
 c a scalar qualifier, various combinations of space, comma and lf delimiters, f-formats, e-formats
 c a blank line within the data read, nulls, a range qualifier, a new object name before end of data
Index: gfortran.dg/namelist_19.f90
===================================================================
--- gfortran.dg/namelist_19.f90	(revision 132670)
+++ gfortran.dg/namelist_19.f90	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! Test namelist error trapping.
 ! provided by Paul Thomas - pault@gcc.gnu.org
 
Index: gfortran.dg/eor_handling_1.f90
===================================================================
--- gfortran.dg/eor_handling_1.f90	(revision 132670)
+++ gfortran.dg/eor_handling_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 17992:  Reading an empty file should yield zero with pad='YES'
 ! (which is the default).
 ! Test case supplied by milan@cmm.ki.si.
Index: gfortran.dg/write_rewind_1.f
===================================================================
--- gfortran.dg/write_rewind_1.f	(revision 132670)
+++ gfortran.dg/write_rewind_1.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 26499 : Positioning of EOF after  write and rewind.
 ! Test case from Dale Ranta in PR.
 ! Submitted by Jerry DeLisle <jvdelisle@verizon.net>.
Index: gfortran.dg/comma.f
===================================================================
--- gfortran.dg/comma.f	(revision 132670)
+++ gfortran.dg/comma.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25419 Default input with commas.
 ! Derived from example given in PR.
 ! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org> 
Index: gfortran.dg/read_eof_2.f90
===================================================================
--- gfortran.dg/read_eof_2.f90	(revision 132670)
+++ gfortran.dg/read_eof_2.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25835 Check that reading from a file that is at end-of-file does not
 ! segfault or give error.  Test case derived from example in PR from Dale Ranta.
 ! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
Index: gfortran.dg/namelist_28.f90
===================================================================
--- gfortran.dg/namelist_28.f90	(revision 132670)
+++ gfortran.dg/namelist_28.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR31052 Bad IOSTAT values when readings NAMELISTs past EOF.
 ! Patch derived from PR, submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
 program gfcbug61
Index: gfortran.dg/record_marker_3.f90
===================================================================
--- gfortran.dg/record_marker_3.f90	(revision 132670)
+++ gfortran.dg/record_marker_3.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-frecord-marker=8" }
 
 program main
Index: gfortran.dg/complex_read.f90
===================================================================
--- gfortran.dg/complex_read.f90	(revision 132670)
+++ gfortran.dg/complex_read.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! Test of the fix to the bug in NIST fm906.for.
 ! Contributed by Paul Thomas  <pault@gcc.gnu.org>
 !
Index: gfortran.dg/namelist_37.f90
===================================================================
--- gfortran.dg/namelist_37.f90	(revision 132670)
+++ gfortran.dg/namelist_37.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR33039 Read NAMELIST:  reads wrong namelist name
 ! Test case from PR modified by Jerry DeLisle <jvdelisle@gcc.gnu.org>
 PROGRAM namelist
Index: gfortran.dg/error_recovery_5.f90
===================================================================
--- gfortran.dg/error_recovery_5.f90	(revision 132670)
+++ gfortran.dg/error_recovery_5.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR34411 hang-up during read of non-expected input
 ! Test case derived from that given in PR
 ! Prior to patch, the do loop was infinite, limits set in this one
Index: gfortran.dg/namelist_char_only.f90
===================================================================
--- gfortran.dg/namelist_char_only.f90	(revision 132670)
+++ gfortran.dg/namelist_char_only.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-O0" }
 ! Test patch for PR24416.f90 - a used to come back from the read with var
 ! prepended.
Index: gfortran.dg/pr18122.f90
===================================================================
--- gfortran.dg/pr18122.f90	(revision 132670)
+++ gfortran.dg/pr18122.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! test namelist with scalars and arrays.
 ! Based on example provided by thomas.koenig@online.de
 
Index: gfortran.dg/list_read_4.f90
===================================================================
--- gfortran.dg/list_read_4.f90	(revision 132670)
+++ gfortran.dg/list_read_4.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! Test of gfortran list directed read> check delimiters are correctly
 ! treated.  Written in f77 so that g77 will run for comparison.
 !
Index: gfortran.dg/eor_handling_2.f90
===================================================================
--- gfortran.dg/eor_handling_2.f90	(revision 132670)
+++ gfortran.dg/eor_handling_2.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 19568:  Don't read across end of line when the format is longer
 !            than the line length and pad='yes' (default)
 program main
Index: gfortran.dg/read_eof_3.f90
===================================================================
--- gfortran.dg/read_eof_3.f90	(revision 132670)
+++ gfortran.dg/read_eof_3.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25835 Check that reading from a file that is at end-of-file does not
 ! segfault or give error.  Test case derived from example in PR from Dale Ranta.
 ! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
Index: gfortran.dg/dollar_edit_descriptor_1.f
===================================================================
--- gfortran.dg/dollar_edit_descriptor_1.f	(revision 132670)
+++ gfortran.dg/dollar_edit_descriptor_1.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-w" }
 ! PR libfortran/20006
       character*5 c
Index: gfortran.dg/pr19467.f90
===================================================================
--- gfortran.dg/pr19467.f90	(revision 132670)
+++ gfortran.dg/pr19467.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! pr 19467
 ! test namelist with character arrays
 ! Based on example provided by paulthomas2@wanadoo.fr
Index: gfortran.dg/namelist_38.f90
===================================================================
--- gfortran.dg/namelist_38.f90	(revision 132670)
+++ gfortran.dg/namelist_38.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR33253 namelist: reading back a string, also fixed writing with delimiters.
 ! Test case modified from that of the PR by
 ! Jerry DeLisle  <jvdelisle@gcc.gnu.org>
Index: gfortran.dg/inquire_9.f90
===================================================================
--- gfortran.dg/inquire_9.f90	(revision 132670)
+++ gfortran.dg/inquire_9.f90	(working copy)
@@ -1,5 +1,5 @@
 ! PR fortran/24774
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
   logical :: l
   l = .true.
   inquire (file='inquire_9 file that should not exist', exist=l)
Index: gfortran.dg/list_read_5.f90
===================================================================
--- gfortran.dg/list_read_5.f90	(revision 132670)
+++ gfortran.dg/list_read_5.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25307 Check handling of end-of-file conditions for list directed reads.
 ! Prepared by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 program pr25307
Index: gfortran.dg/noadv_size.f90
===================================================================
--- gfortran.dg/noadv_size.f90	(revision 132670)
+++ gfortran.dg/noadv_size.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 20774: Handle size parameter for non-advancing I/O correctly
 program main
   open(77,status='scratch')
Index: gfortran.dg/backslash_1.f90
===================================================================
--- gfortran.dg/backslash_1.f90	(revision 132670)
+++ gfortran.dg/backslash_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
       character(len=4) a
       open (10, status='scratch')
       write (10,'(A)') '1\n2'
Index: gfortran.dg/eor_handling_3.f90
===================================================================
--- gfortran.dg/eor_handling_3.f90	(revision 132670)
+++ gfortran.dg/eor_handling_3.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 19595:  Handle end-of-record condition with pad=yes (default)
 program main
   integer i1, i2
Index: gfortran.dg/read_eof_4.f90
===================================================================
--- gfortran.dg/read_eof_4.f90	(revision 132670)
+++ gfortran.dg/read_eof_4.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 27575 and PR 30009: This test checks the error checking for end
 ! of file condition.
 ! Derived from test case in PR.
Index: gfortran.dg/runtime_warning_1.f90
===================================================================
--- gfortran.dg/runtime_warning_1.f90	(revision 132670)
+++ gfortran.dg/runtime_warning_1.f90	(working copy)
@@ -3,7 +3,7 @@
 ! Contributor Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 !
 ! { dg-options "-pedantic" }
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 !
      character*5 c
      open (42,status='scratch')
Index: gfortran.dg/x_slash_1.f
===================================================================
--- gfortran.dg/x_slash_1.f	(revision 132670)
+++ gfortran.dg/x_slash_1.f	(working copy)
@@ -1,4 +1,4 @@
-c { dg-do run }
+c { dg-do run { target fd_truncate } }
 c This program tests the fixes to PR22570.
 c
 c Provided by Paul Thomas - pault@gcc.gnu.org
Index: gfortran.dg/namelist_39.f90
===================================================================
--- gfortran.dg/namelist_39.f90	(revision 132670)
+++ gfortran.dg/namelist_39.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR33421 and PR33253 Weird quotation of namelist output of character arrays
 ! Test case from Toon Moone, adapted by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
Index: gfortran.dg/streamio_3.f90
===================================================================
--- gfortran.dg/streamio_3.f90	(revision 132670)
+++ gfortran.dg/streamio_3.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25828 Stream IO test 3, tests read_x and inquire.
 ! Contributed by Jerry DeLisle <jvdelisle@verizon.net>.
 program streamio_3
Index: gfortran.dg/read_comma.f
===================================================================
--- gfortran.dg/read_comma.f	(revision 132670)
+++ gfortran.dg/read_comma.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25039 This test checks that commas in input fields for formatted sequential
 ! reads are interpreted as the read completion.  If no comma is encountered the
 ! normal field width determines the end of the read.  The test case also checks
Index: gfortran.dg/pr19657.f
===================================================================
--- gfortran.dg/pr19657.f	(revision 132670)
+++ gfortran.dg/pr19657.f	(working copy)
@@ -1,4 +1,4 @@
-c { dg-do run }
+c { dg-do run { target fd_truncate } }
 c pr 19657
 c test namelist not skipped if ending with logical.
 c Based on example provided by fuyuki@ccsr.u-tokyo.ac.jp
Index: gfortran.dg/streamio_15.f90
===================================================================
--- gfortran.dg/streamio_15.f90	(revision 132670)
+++ gfortran.dg/streamio_15.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR35132 Formatted stream I/O write should truncate.
 ! Test case adapted from PR by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 program main
Index: gfortran.dg/list_read_6.f90
===================================================================
--- gfortran.dg/list_read_6.f90	(revision 132670)
+++ gfortran.dg/list_read_6.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR30435 Slash at end of input not recognized according to standard.
 ! Test case from PR by Steve Kargl.
 
Index: gfortran.dg/eor_handling_4.f90
===================================================================
--- gfortran.dg/eor_handling_4.f90	(revision 132670)
+++ gfortran.dg/eor_handling_4.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 20092, 20131:  Handle end-of-record condition with pad=yes (default)
 ! for standard input.  This test case only really tests  anything if,
 ! by changing unit 5, you get to manipulate the standard input.
Index: gfortran.dg/backslash_2.f90
===================================================================
--- gfortran.dg/backslash_2.f90	(revision 132670)
+++ gfortran.dg/backslash_2.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-fbackslash" }
       integer :: i, e
       open (10, status='scratch')
Index: gfortran.dg/pr19216.f
===================================================================
--- gfortran.dg/pr19216.f	(revision 132670)
+++ gfortran.dg/pr19216.f	(working copy)
@@ -1,5 +1,5 @@
 ! PR libfortran/19216
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
        integer dat(3), i, j
        data dat / 3,2,1 /
 
Index: gfortran.dg/PR19872.f
===================================================================
--- gfortran.dg/PR19872.f	(revision 132670)
+++ gfortran.dg/PR19872.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run } 
+! { dg-do run { target fd_truncate } } 
 ! PR 19872 - closed and re-opened file not overwriten
       implicit none
       integer i(4)
Index: gfortran.dg/backspace_2.f
===================================================================
--- gfortran.dg/backspace_2.f	(revision 132670)
+++ gfortran.dg/backspace_2.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25139 Repeated backspaces and reads.
 ! Derived from example given in PR by Dale Ranta and FX Coudert
 ! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org> 
Index: gfortran.dg/empty_format_1.f90
===================================================================
--- gfortran.dg/empty_format_1.f90	(revision 132670)
+++ gfortran.dg/empty_format_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 17709
 ! We weren't resetting the internal EOR flag correctly, so the second read
 ! wasn't advancing to the next line.
Index: gfortran.dg/streamio_4.f90
===================================================================
--- gfortran.dg/streamio_4.f90	(revision 132670)
+++ gfortran.dg/streamio_4.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25828 Stream IO test 4, Tests string read and writes, single byte.
 ! Verifies buffering is working correctly and position="append"
 ! Contributed by Jerry DeLisle <jvdelisle@verizon.net>.
Index: gfortran.dg/append_1.f90
===================================================================
--- gfortran.dg/append_1.f90	(revision 132670)
+++ gfortran.dg/append_1.f90	(working copy)
@@ -1,7 +1,7 @@
 ! PR libfortran/21471
 ! Testing POSITION="APPEND"
 !
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
       subroutine failed
         close (10,status='delete')
         call abort
Index: gfortran.dg/fgetc_1.f90
===================================================================
--- gfortran.dg/fgetc_1.f90	(revision 132670)
+++ gfortran.dg/fgetc_1.f90	(working copy)
@@ -1,5 +1,5 @@
 ! Testcase for the FGETC and FPUTC intrinsics
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
   character(len=5) s
   integer st
 
Index: gfortran.dg/complex_write.f90
===================================================================
--- gfortran.dg/complex_write.f90	(revision 132670)
+++ gfortran.dg/complex_write.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! pr 19071
 ! test case provided by
 !   Thomas.Koenig@online.de
Index: gfortran.dg/list_read_7.f90
===================================================================
--- gfortran.dg/list_read_7.f90	(revision 132670)
+++ gfortran.dg/list_read_7.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR33400 Formatted read fails if line ends without line break
 ! Test case modified from that in PR by <jvdelisle@gcc.gnu.org>
 integer, parameter :: fgsl_strmax = 128
Index: gfortran.dg/eor_handling_5.f90
===================================================================
--- gfortran.dg/eor_handling_5.f90	(revision 132670)
+++ gfortran.dg/eor_handling_5.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 20661: Handle non-advancing I/O with iostat
 ! Test case by Walt Brainerd, The Fortran Company
 
Index: gfortran.dg/fmt_t_1.f90
===================================================================
--- gfortran.dg/fmt_t_1.f90	(revision 132670)
+++ gfortran.dg/fmt_t_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
       integer nrow, vec(15)
       open (10, status="scratch")
       write (10, fmt='(a)') '001    1 2 3 4 5 6'
Index: gfortran.dg/pr17090.f90
===================================================================
--- gfortran.dg/pr17090.f90	(revision 132670)
+++ gfortran.dg/pr17090.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! pr 17090 Runtime I/O error
 ! bdavis9659@comcast.net 
 ! 9/12/2004
Index: gfortran.dg/backspace_4.f
===================================================================
--- gfortran.dg/backspace_4.f	(revision 132670)
+++ gfortran.dg/backspace_4.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25598 Error on repeated backspaces.
 ! Derived from example given in PR by Dale Ranta
 ! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org> 
Index: gfortran.dg/shape_3.f90
===================================================================
--- gfortran.dg/shape_3.f90	(revision 132670)
+++ gfortran.dg/shape_3.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 34980 - we got a segfault for calling shape
 !            with a scalar.
 program main
Index: gfortran.dg/unf_io_convert_1.f90
===================================================================
--- gfortran.dg/unf_io_convert_1.f90	(revision 132670)
+++ gfortran.dg/unf_io_convert_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-pedantic" }
 !  This test verifies the most basic sequential unformatted I/O
 !  with convert="swap".
Index: gfortran.dg/fgetc_2.f90
===================================================================
--- gfortran.dg/fgetc_2.f90	(revision 132670)
+++ gfortran.dg/fgetc_2.f90	(working copy)
@@ -1,5 +1,5 @@
 ! Testcase for the FGETC and FPUTC intrinsics
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
   character(len=5) s
   integer st
 
Index: gfortran.dg/vector_subscript_3.f90
===================================================================
--- gfortran.dg/vector_subscript_3.f90	(revision 132670)
+++ gfortran.dg/vector_subscript_3.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 !
 ! Test the fix for PR34875, in which the read with a vector index
 ! used to do nothing.
Index: gfortran.dg/list_read_8.f90
===================================================================
--- gfortran.dg/list_read_8.f90	(revision 132670)
+++ gfortran.dg/list_read_8.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR34676 IO error delayed
 ! Test case from PR modified by <jvdelisle@gcc.gnu.org>
 implicit none
Index: gfortran.dg/flush_1.f90
===================================================================
--- gfortran.dg/flush_1.f90	(revision 132670)
+++ gfortran.dg/flush_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 22390 Implement flush statement
 program flush_1
 
Index: gfortran.dg/advance_1.f90
===================================================================
--- gfortran.dg/advance_1.f90	(revision 132670)
+++ gfortran.dg/advance_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR25463 Check that advance='no' works correctly.
 ! Derived from example given in PR by Thomas Koenig
 ! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org> 
Index: gfortran.dg/fmt_t_2.f90
===================================================================
--- gfortran.dg/fmt_t_2.f90	(revision 132670)
+++ gfortran.dg/fmt_t_2.f90	(working copy)
@@ -1,5 +1,5 @@
 ! { dg-options "" }
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! pr24699, handle end-of-record on READ with T format
 ! test contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>
       character*132 :: foost1, foost2, foost3
Index: gfortran.dg/backspace_6.f
===================================================================
--- gfortran.dg/backspace_6.f	(revision 132670)
+++ gfortran.dg/backspace_6.f	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! PR26464 File I/O error related to buffering and BACKSPACE
 ! Test case derived from case by Dale Ranta.
 ! Submitted  by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
Index: gfortran.dg/slash_1.f90
===================================================================
--- gfortran.dg/slash_1.f90	(revision 132670)
+++ gfortran.dg/slash_1.f90	(working copy)
@@ -1,5 +1,5 @@
 ! PR libfortran/22170
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
   integer i
   open (10,status='scratch')
   write (10,'(A,2/,A)') '12', '17'
Index: gfortran.dg/stat_1.f90
===================================================================
--- gfortran.dg/stat_1.f90	(revision 132670)
+++ gfortran.dg/stat_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-std=gnu" }
   character(len=*), parameter :: f = "testfile"
   integer :: s1(13), r1, s2(13), r2, s3(13), r3
Index: gfortran.dg/unformatted_recl_1.f90
===================================================================
--- gfortran.dg/unformatted_recl_1.f90	(revision 132670)
+++ gfortran.dg/unformatted_recl_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run } 
+! { dg-do run { target fd_truncate } } 
 ! PR31099 Runtime error on legal code using RECL
 program test
   integer(kind=4) :: a, b
Index: gfortran.dg/record_marker_2.f
===================================================================
--- gfortran.dg/record_marker_2.f	(revision 132670)
+++ gfortran.dg/record_marker_2.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-frecord-marker=4" }
 ! This file is all about BACKSPACE
 ! Adapted from gfortran.dg/backspace.f
Index: gfortran.dg/overwrite_1.f
===================================================================
--- gfortran.dg/overwrite_1.f	(revision 132670)
+++ gfortran.dg/overwrite_1.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run } 
+! { dg-do run { target fd_truncate } } 
 ! PR 19872 - closed and re-opened file not overwriten
       implicit none
       integer i(4)
Index: gfortran.dg/unf_io_convert_2.f90
===================================================================
--- gfortran.dg/unf_io_convert_2.f90	(revision 132670)
+++ gfortran.dg/unf_io_convert_2.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 program main
   complex(kind=4) :: c
   real(kind=4) :: a(2)
Index: gfortran.dg/fmt_t_3.f90
===================================================================
--- gfortran.dg/fmt_t_3.f90	(revision 132670)
+++ gfortran.dg/fmt_t_3.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR31051 bug with x and t format descriptors.
 ! Test case prepared by Jerry DeLisle  <jvdelisle@gcc.gnu.org> from PR.
 program t
Index: gfortran.dg/backspace_8.f
===================================================================
--- gfortran.dg/backspace_8.f	(revision 132670)
+++ gfortran.dg/backspace_8.f	(working copy)
@@ -1,4 +1,4 @@
-C { dg-do run }
+C { dg-do run { target fd_truncate } }
 C PR libfortran/31618 - backspace after an error didn't work.
       program main
       character*78 msg
Index: gfortran.dg/stat_2.f90
===================================================================
--- gfortran.dg/stat_2.f90	(revision 132670)
+++ gfortran.dg/stat_2.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-std=gnu" }
   character(len=*), parameter :: f = "testfile"
   integer :: s1(13), r1, s2(13), r2, s3(13), r3
Index: gfortran.dg/pr18210.f90
===================================================================
--- gfortran.dg/pr18210.f90	(revision 132670)
+++ gfortran.dg/pr18210.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! Names in upper case and object names starting column 2
 ! Based on example provided by thomas.koenig@online.de
 
Index: gfortran.dg/unformatted_subrecord_1.f90
===================================================================
--- gfortran.dg/unformatted_subrecord_1.f90	(revision 132670)
+++ gfortran.dg/unformatted_subrecord_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! { dg-options "-fmax-subrecord-length=16" }
 ! Test Intel record markers with 16-byte subrecord sizes.
 ! PR 32770:  Use explicit kinds for all integers and constants,
Index: gfortran.dg/pr20257.f90
===================================================================
--- gfortran.dg/pr20257.f90	(revision 132670)
+++ gfortran.dg/pr20257.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
   integer,parameter :: n = 10000
   real(8) array(10000)
 
Index: gfortran.dg/eof_1.f90
===================================================================
--- gfortran.dg/eof_1.f90	(revision 132670)
+++ gfortran.dg/eof_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! Program to test for proper EOF errors when reading past the end of a file.
 ! We used to get this wrong when a formatted read followed a list formatted
 ! read.
Index: gfortran.dg/fmt_t_4.f90
===================================================================
--- gfortran.dg/fmt_t_4.f90	(revision 132670)
+++ gfortran.dg/fmt_t_4.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR31199, test case from PR report.
        program write_write
        character(len=20) :: a,b,c
Index: gfortran.dg/unf_short_record_1.f90
===================================================================
--- gfortran.dg/unf_short_record_1.f90	(revision 132670)
+++ gfortran.dg/unf_short_record_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 29627 - partial reads of unformatted records
 program main
   character a(3)
Index: gfortran.dg/fmt_exhaust.f90
===================================================================
--- gfortran.dg/fmt_exhaust.f90	(revision 132670)
+++ gfortran.dg/fmt_exhaust.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR27304 Test running out of data descriptors with data remaining.
 ! Derived from case in PR.  Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>.
       program test
Index: gfortran.dg/namelist_20.f90
===================================================================
--- gfortran.dg/namelist_20.f90	(revision 132670)
+++ gfortran.dg/namelist_20.f90	(working copy)
@@ -1,4 +1,4 @@
-!{ dg-do run }
+!{ dg-do run { target fd_truncate } }
 ! Tests namelist io for an explicit shape array with negative bounds
 ! provided by Paul Thomas - pault@gcc.gnu.org
 
Index: gfortran.dg/advance_4.f90
===================================================================
--- gfortran.dg/advance_4.f90	(revision 132670)
+++ gfortran.dg/advance_4.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR31207 Last record truncated for read after short write
 program main
   character(10) :: answer
@@ -7,4 +7,4 @@
   read (12, '(6A)') answer
   close (12, status="delete")
   if (answer /= "XABCDX") call abort()
-end program main
\ No newline at end of file
+end program main
Index: gfortran.dg/fmt_t_5.f90
===================================================================
--- gfortran.dg/fmt_t_5.f90	(revision 132670)
+++ gfortran.dg/fmt_t_5.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR32678 GFortan works incorrectly when writing with FORMAT Tx
 ! Before patch, NULLs were inserted in output.
 ! Test case from reporter enhanced to detect this problem.
Index: gfortran.dg/namelist_12.f
===================================================================
--- gfortran.dg/namelist_12.f	(revision 132670)
+++ gfortran.dg/namelist_12.f	(working copy)
@@ -1,4 +1,4 @@
-c{ dg-do run }
+c{ dg-do run { target fd_truncate } }
 c This program repeats many of the same tests as test_nml_1 but for integer
 c instead of real. It also tests repeat nulls, comma delimited character read,
 c a triplet qualifier, a range with an assumed start, a quote delimited string,
Index: gfortran.dg/backspace_7.f90
===================================================================
--- gfortran.dg/backspace_7.f90	(revision 132670)
+++ gfortran.dg/backspace_7.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 !pr18284 BACKSPACE broken
        open(unit=10,access='SEQUENTIAL',status='SCRATCH')
        do I = 1,200
Index: gfortran.dg/write_rewind_2.f
===================================================================
--- gfortran.dg/write_rewind_2.f	(revision 132670)
+++ gfortran.dg/write_rewind_2.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 26499  Test write with rewind sequences to make sure buffering and
 ! end-of-file conditions are handled correctly.  Derived from test case by Dale
 ! Ranta.  Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>.
Index: gfortran.dg/ftell_1.f90
===================================================================
--- gfortran.dg/ftell_1.f90	(revision 132670)
+++ gfortran.dg/ftell_1.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
   integer(kind=8) o, o2
 
   open (10, status="scratch")
Index: gfortran.dg/fseek.f90
===================================================================
--- gfortran.dg/fseek.f90	(revision 132670)
+++ gfortran.dg/fseek.f90	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 
 PROGRAM test_fseek
   INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2, fd=10
Index: gfortran.dg/write_back.f
===================================================================
--- gfortran.dg/write_back.f	(revision 132670)
+++ gfortran.dg/write_back.f	(working copy)
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target fd_truncate } }
 ! PR 26499 : Positioning of EOF after backspaces and write.
 ! This test verifies that the last write truncates the file.
 ! Submitted by Jerry DeLisle <jvdelisle@verizon.net>.

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]