diff mbox

Add checkpoint to libgomp dg-shouldfail tests (was: [PR testsuite/65205] Fix dg-shouldfail usage in OpenACC libgomp tests)

Message ID 874191C2-249E-487C-B384-35DF0E19DDF4@gmail.com
State New
Headers show

Commit Message

FX Coudert Aug. 14, 2015, 11:19 a.m. UTC
> (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:



I hope this helps,
FX
diff mbox

Patch

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