1 ! Test 'allocatable' with OpenACC data clauses, subroutine in module, pass by
4 ! See also '../libgomp.fortran/target-allocatable-1-2.f90'.
7 ! { dg-additional-options "-cpp" }
11 subroutine r (a
, b
, c
, d
, e
)
13 integer, allocatable
:: a
, b
, c
, d
, e
15 !$acc parallel copyin(a) copy(b, c, d) copyout(e)
17 if (.not
. allocated (a
)) stop 1
21 if (.not
. allocated (b
)) stop 3
24 if (.not
. allocated (c
)) stop 5
28 if (allocated (d
)) stop 7
29 d
= 42 ! Implicit allocation, but on device only.
30 if (.not
. allocated (d
)) stop 8
31 deallocate (d
) ! OpenMP requires must be "unallocated upon exit from the region".
33 if (allocated (e
)) stop 9
34 e
= 24 ! Implicit allocation, but on device only.
35 if (.not
. allocated (e
)) stop 10
36 deallocate (e
) ! OpenMP requires must be "unallocated upon exit from the region".
46 integer, allocatable
:: a
, b
, c
, d
, e
51 b
= 25 ! Implicit allocation.
53 c
= 52 ! Implicit allocation.
55 !No 'allocate (d)' here.
57 !No 'allocate (e)' here.
61 if (.not
. allocated (a
)) stop 20
63 if (a
.ne
. 33) stop 21
65 if (a
.ne
. 11) stop 22
69 if (.not
. allocated (b
)) stop 23
70 if (b
.ne
. 25) stop 24
73 if (.not
. allocated (c
)) stop 25
74 if (c
.ne
. 10) stop 26
77 if (allocated (d
)) stop 27
79 if (allocated (e
)) stop 28