1 ! Test allocatables in HAS_DEVICE_ADDR.
8 integer, parameter :: N
= 5
9 integer, allocatable
:: x
10 integer, allocatable
:: y(:)
13 call array_dummy_optional (y
)
14 call array_dummy_optional ()
17 subroutine scalar_dummy (a
)
18 integer, allocatable
:: a
23 !$omp target data map(a) use_device_addr(a)
24 !$omp target has_device_addr(a)
31 end subroutine scalar_dummy
33 subroutine array_dummy (a
)
34 integer, allocatable
:: a(:)
40 !$omp target data map(a) use_device_addr(a)
41 !$omp target has_device_addr(a)
45 if (any (a
/= [(i
, i
=1, N
)])) stop 2
48 end subroutine array_dummy
50 subroutine array_dummy_optional (a
)
51 integer, optional
, allocatable
:: a(:)
59 !$omp target data map(a) use_device_addr(a)
60 !$omp target has_device_addr(a)
61 if (present (a
)) a
= [(i
, i
=1, N
)]
66 if (any (a
/= [(i
, i
=1, N
)])) stop 2
69 end subroutine array_dummy_optional