Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / mdc-refcount-1-2-2.f90
blob78f54e64dcea6e62bcb0563c8d737d773bbf81ce
1 ! { dg-do run }
2 ! { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } }
4 ! Copy of 'libgomp.oacc-fortran/mdc-refcount-1-2-1.f90', without 'finalize' clause.
6 program main
7 use openacc
8 implicit none
9 integer, parameter :: n = 512
10 type mytype
11 integer, allocatable :: a(:)
12 end type mytype
13 type(mytype) :: var
15 allocate(var%a(1:n))
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 delete(var%a)
27 if (acc_is_present(var%a)) stop 3
28 if (.not. acc_is_present(var)) stop 4
30 !$acc end data
31 if (acc_is_present(var%a)) stop 5
32 if (acc_is_present(var)) stop 6
34 deallocate(var%a)
36 end program main