1 ! Test whether use_device_ptr properly handles OPTIONAL arguments
2 ! (Only case of present arguments is tested)
6 integer, pointer :: ptr_i
, ptr_null
15 integer, pointer, optional
:: ii
17 if (.not
.present(ii
)) call abort()
18 if (.not
.associated(ii
, ixx
)) call abort()
19 !$omp target data map(to:ixx) use_device_ptr(ii)
20 if (.not
.present(ii
)) call abort()
21 if (.not
.associated(ii
)) call abort()
25 ! For bar, it is assumed that a NULL ptr on the host maps to NULL on the device
27 integer, pointer, optional
:: jj
29 if (.not
.present(jj
)) call abort()
30 if (associated(jj
)) call abort()
31 !$omp target data map(to:ixx) use_device_ptr(jj)
32 if (.not
.present(jj
)) call abort()
33 if (associated(jj
)) call abort()