1! { dg-do run }
2! { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } }
3
4! Adapted from 'libgomp.oacc-fortran/deep-copy-6.f90'.
5
6program 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
14
15  allocate(var%a(1:n))
16
17  !$acc data create(var)
18
19  !$acc enter data create(var%a)
20
21  if (.not. acc_is_present(var%a)) stop 1
22  if (.not. acc_is_present(var)) stop 2
23
24  !$acc exit data delete(var%a) finalize
25  if (acc_is_present(var%a)) stop 3
26  if (.not. acc_is_present(var)) stop 4
27
28  !$acc end data
29  if (acc_is_present(var%a)) stop 5
30  if (acc_is_present(var)) stop 6
31
32  deallocate(var%a)
33
34end program main
35