Add checkpoint to libgomp dg-shouldfail tests (was: [PR testsuite/65205] Fix dg-shouldfail usage in OpenACC libgomp tests)
FX
fxcoudert@gmail.com
Fri Aug 14 11:19:00 GMT 2015
> (Can a Fortran person please comment on this: as it's nontrivial to write
> to stderr, let's just write to stdout followed by a flush, which does
> have the same ordering effect -- OK?)
Although there are no absolute guarantees on flushing, it should work in practice.
Note that the FLUSH subroutine (as in “call flush”) is nonstandard. The standard way to achieve this is the FLUSH statement:
use iso_fortran_env, only : output_unit
flush output_unit
where the first line (“use …”) goes at the very top of the routine/program, above “implicit none”. So the patch for, e.g., libgomp.oacc-fortran/data-already-7.f would be:
Index: libgomp/testsuite/libgomp.oacc-fortran/data-already-7.f
===================================================================
--- libgomp/testsuite/libgomp.oacc-fortran/data-already-7.f (revision 226823)
+++ libgomp/testsuite/libgomp.oacc-fortran/data-already-7.f (working copy)
@@ -1,5 +1,6 @@
! { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } }
+ USE ISO_FORTRAN_ENV, ONLY: OUTPUT_UNIT
IMPLICIT NONE
INCLUDE "openacc_lib.h"
@@ -7,6 +8,8 @@
!$ACC ENTER DATA CREATE (I)
CALL ACC_CREATE (I)
+ PRINT *, "CheCKpOInT"
+ FLUSH OUTPUT_UNIT
END
I hope this helps,
FX
More information about the Fortran
mailing list