2 ! { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } }
4 ! Copy of 'libgomp.oacc-fortran/mdc-refcount-1-3-1.f90', without 'finalize' clause.
9 integer, parameter :: n
= 512
11 integer, allocatable
:: a(:)
17 !$acc data create(var)
19 call acc_create(var
%a
)
20 ! After mapping via runtime API call, separately trigger attach action; see <https://github.com/OpenACC/openacc-spec/issues/301>.
21 !$acc enter data attach(var%a)
23 if (.not
. acc_is_present(var
%a
)) stop 1
24 if (.not
. acc_is_present(var
)) stop 2
26 !$acc exit data detach(var%a)
27 print *, "CheCKpOInT1"
28 ! { dg-output ".*CheCKpOInT1(\n|\r\n|\r)" }
29 !$acc exit data delete(var%a)
30 !TODO { dg-output "(\n|\r\n|\r)libgomp: attach count underflow(\n|\r\n|\r)$" { target { ! openacc_host_selected } } } ! Scan for what we expect in the "XFAILed" case (without actually XFAILing).
31 !TODO { dg-shouldfail "XFAILed" { ! openacc_host_selected } } ! ... instead of 'dg-xfail-run-if' so that 'dg-output' is evaluated at all.
32 !TODO { dg-final { if { [dg-process-target { xfail { ! openacc_host_selected } }] == "F" } { xfail "[testname-for-summary] really is XFAILed" } } } ! ... so that we still get an XFAIL visible in the log.
33 print *, "CheCKpOInT2"
34 ! { dg-output ".CheCKpOInT2(\n|\r\n|\r)" { target { openacc_host_selected } } }
35 if (acc_is_present(var
%a
)) stop 3
36 if (.not
. acc_is_present(var
)) stop 4
39 if (acc_is_present(var
%a
)) stop 5
40 if (acc_is_present(var
)) stop 6