| 1 |
! { dg-additional-options "-fopenmp-allocators" } |
| 2 |
module m |
| 3 |
implicit none |
| 4 |
type t |
| 5 |
integer, allocatable :: Acomp, Bcomp(:) |
| 6 |
class(*), allocatable :: Ccomp, Dcomp(:) |
| 7 |
end type t |
| 8 |
contains |
| 9 |
|
| 10 |
subroutine intout(c,d,e,f) |
| 11 |
implicit none |
| 12 |
class(t), intent(out) :: c,d(4) |
| 13 |
class(t), allocatable, intent(out) :: e,f(:) |
| 14 |
end |
| 15 |
|
| 16 |
subroutine q(c,d,e,f) |
| 17 |
implicit none |
| 18 |
class(t) :: c,d(4) |
| 19 |
class(t), allocatable :: e,f(:) |
| 20 |
call intout(c,d,e,f) |
| 21 |
end subroutine q |
| 22 |
|
| 23 |
subroutine s |
| 24 |
implicit none |
| 25 |
type(t) :: xx |
| 26 |
class(t), allocatable :: yy |
| 27 |
integer :: i, iiiiii |
| 28 |
i = 4 |
| 29 |
!$omp allocate |
| 30 |
allocate(xx%Acomp, xx%Bcomp(4)) |
| 31 |
deallocate(xx%Acomp, xx%Bcomp) |
| 32 |
|
| 33 |
!$omp allocate |
| 34 |
allocate(integer :: xx%Ccomp, xx%Dcomp(4)) |
| 35 |
deallocate(xx%Ccomp, xx%Dcomp) |
| 36 |
|
| 37 |
!$omp allocators allocate(yy) |
| 38 |
allocate(t :: yy) |
| 39 |
|
| 40 |
!$omp allocate |
| 41 |
allocate(real :: xx%Ccomp, xx%Dcomp(4)) |
| 42 |
deallocate(xx%Ccomp, xx%Dcomp) |
| 43 |
|
| 44 |
!$omp allocate |
| 45 |
allocate(xx%Acomp, xx%Bcomp(4)) |
| 46 |
!$omp allocate |
| 47 |
allocate(logical :: xx%Ccomp, xx%Dcomp(4)) |
| 48 |
|
| 49 |
iiiiii = 555 |
| 50 |
xx = t(1, [1,2]) |
| 51 |
end |
| 52 |
|
| 53 |
end module |
| 54 |
|
| 55 |
use m |
| 56 |
call s |
| 57 |
end |