mdc-refcount-1-1-1.f90 710 B

12345678910111213141516171819202122232425262728293031323334
  1. ! { dg-do run }
  2. ! { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } }
  3. ! Adapted from 'libgomp.oacc-fortran/deep-copy-6.f90'.
  4. program main
  5. use openacc
  6. implicit none
  7. integer, parameter :: n = 512
  8. type mytype
  9. integer, allocatable :: a(:)
  10. end type mytype
  11. type(mytype) :: var
  12. allocate(var%a(1:n))
  13. !$acc data create(var)
  14. !$acc enter data create(var%a)
  15. if (.not. acc_is_present(var%a)) stop 1
  16. if (.not. acc_is_present(var)) stop 2
  17. !$acc exit data delete(var%a) finalize
  18. if (acc_is_present(var%a)) stop 3
  19. if (.not. acc_is_present(var)) stop 4
  20. !$acc end data
  21. if (acc_is_present(var%a)) stop 5
  22. if (acc_is_present(var)) stop 6
  23. deallocate(var%a)
  24. end program main