1 ! { dg-additional-options "-fdump-tree-original" }
14 subroutine test(aa
, bb
)
15 use iso_c_binding
, only
: c_ptr
, c_loc
, c_f_pointer
17 integer, target
:: cc
, dd
18 type(c_ptr
) :: pcc
, pdd
22 !$omp target enter data map(to: aa, bb, cc, dd)
24 !$omp target data use_device_ptr(aa, cc) use_device_addr(bb, dd)
28 ! TODO: has_device_addr(cc, dd)
29 !$omp target is_device_ptr(aa, bb)
30 if (aa
/= 83 .or
. bb
/= 73) stop 1
34 integer, pointer :: c2
, d2
35 call c_f_pointer(pcc
, c2
)
36 call c_f_pointer(pdd
, d2
)
37 if (c2
/= 131 .or
. d2
/= 484) stop 2
44 !$omp target exit data map(from:aa, bb, cc, dd)
46 if (aa
/= 42 .or
. bb
/= 43) stop 3
47 if (cc
/= 44 .or
. dd
/= 45) stop 5
51 ! { dg-final { scan-tree-dump-times "omp target data .*use_device_addr\\(aa\\)" 1 "original" } }
52 ! { dg-final { scan-tree-dump-times "omp target data .*use_device_addr\\(bb\\)" 1 "original" } }
53 ! { dg-final { scan-tree-dump-times "omp target data .*use_device_addr\\(cc\\)" 1 "original" } }
54 ! { dg-final { scan-tree-dump-times "omp target data .*use_device_addr\\(dd\\)" 1 "original" } }