2 ! { dg-options "-fcoarray=single -fcheck=bounds" }
4 ! Coarray support -- allocatable array coarrays
5 ! -- intrinsic procedures
11 integer,allocatable
:: B(:)[:]
23 integer, allocatable
:: a(:)[:,:,:]
24 allocate(a(1)[-4:9,8,4:*])
26 if (this_image(a
,dim
=1) /= -4_8) STOP 1
27 if (lcobound (a
,dim
=1) /= -4_8) STOP 2
28 if (ucobound (a
,dim
=1) /= 9_8) STOP 3
30 if (this_image(a
,dim
=2) /= 1_8) STOP 4
31 if (lcobound (a
,dim
=2) /= 1_8) STOP 5
32 if (ucobound (a
,dim
=2) /= 8_8) STOP 6
34 if (this_image(a
,dim
=3) /= 4_8) STOP 7
35 if (lcobound (a
,dim
=3) /= 4_8) STOP 8
36 if (ucobound (a
,dim
=3) /= 4_8) STOP 9
38 if (any(this_image(a
) /= [-4_8, 1_8, 4_8])) STOP 10
39 if (any(lcobound (a
) /= [-4_8, 1_8, 4_8])) STOP 11
40 if (any(ucobound (a
) /= [9_8, 8_8, 4_8])) STOP 12
44 integer, allocatable
:: a(:)[:,:,:]
45 allocate(a(1)[-4:9,8,4:*])
47 if (this_image(a
,dim
=1) /= -4) STOP 13
48 if (lcobound (a
,dim
=1) /= -4) STOP 14
49 if (ucobound (a
,dim
=1) /= 9) STOP 15
51 if (this_image(a
,dim
=2) /= 1) STOP 16
52 if (lcobound (a
,dim
=2) /= 1) STOP 17
53 if (ucobound (a
,dim
=2) /= 8) STOP 18
55 if (this_image(a
,dim
=3) /= 4) STOP 19
56 if (lcobound (a
,dim
=3) /= 4) STOP 20
57 if (ucobound (a
,dim
=3) /= 4) STOP 21
59 if (any(this_image(a
) /= [-4, 1, 4])) STOP 22
60 if (any(lcobound (a
) /= [-4, 1, 4])) STOP 23
61 if (any(ucobound (a
) /= [9, 8, 4])) STOP 24
64 subroutine three(n
,A
, n2
)
69 if (A(1) /= 42) STOP 25
71 if (A(1)[n2
] /= -42) STOP 26
73 if (this_image(A
,dim
=1) /= n
) STOP 27
74 if (lcobound (A
,dim
=1) /= n
) STOP 28
75 if (ucobound (A
,dim
=1) /= n
) STOP 29
77 if (any(this_image(A
) /= n
)) STOP 30
78 if (any(lcobound (A
) /= n
)) STOP 31
79 if (any(ucobound (A
) /= n
)) STOP 32
82 subroutine three_a(n
,A
)
84 integer :: A(3)[n
+2:n
+5,n
-1:*]
87 if (A(1) /= 42) STOP 33
89 if (A(1)[4,n
] /= -42) STOP 34
91 if (this_image(A
,dim
=1) /= n
+2) STOP 35
92 if (lcobound (A
,dim
=1) /= n
+2) STOP 36
93 if (ucobound (A
,dim
=1) /= n
+5) STOP 37
95 if (this_image(A
,dim
=2) /= n
-1) STOP 38
96 if (lcobound (A
,dim
=2) /= n
-1) STOP 39
97 if (ucobound (A
,dim
=2) /= n
-1) STOP 40
99 if (any(this_image(A
) /= [n
+2,n
-1])) STOP 41
100 if (any(lcobound (A
) /= [n
+2,n
-1])) STOP 42
101 if (any(ucobound (A
) /= [n
+5,n
-1])) STOP 43
102 end subroutine three_a
104 subroutine three_b(n
,A
)
106 integer :: A(-1:3,0:4,-2:5,-4:7)[n
+2:n
+5,n
-1:*]
109 if (A(-1,0,-2,-4) /= 42) STOP 44
111 if (A(1,0,-2,-4) /= 99) STOP 45
113 if (this_image(A
,dim
=1) /= n
+2) STOP 46
114 if (lcobound (A
,dim
=1) /= n
+2) STOP 47
115 if (ucobound (A
,dim
=1) /= n
+5) STOP 48
117 if (this_image(A
,dim
=2) /= n
-1) STOP 49
118 if (lcobound (A
,dim
=2) /= n
-1) STOP 50
119 if (ucobound (A
,dim
=2) /= n
-1) STOP 51
121 if (any(this_image(A
) /= [n
+2,n
-1])) STOP 52
122 if (any(lcobound (A
) /= [n
+2,n
-1])) STOP 53
123 if (any(ucobound (A
) /= [n
+5,n
-1])) STOP 54
124 end subroutine three_b
127 integer, allocatable
:: A(:)[:]
128 if (this_image(A
,dim
=1) /= -4_8) STOP 55
129 if (lcobound (A
,dim
=1) /= -4_8) STOP 56
130 if (ucobound (A
,dim
=1) /= -4_8) STOP 57
134 integer, save :: foo(2)[5:7,4:*]
139 if (foo(1)[5,4] /= 42) STOP 58
140 if (this_image(foo
,dim
=i
) /= 5) STOP 59
141 if (lcobound(foo
,dim
=i
) /= 5) STOP 60
142 if (ucobound(foo
,dim
=i
) /= 7) STOP 61
145 if (this_image(foo
,dim
=i
) /= 4) STOP 62
146 if (lcobound(foo
,dim
=i
) /= 4) STOP 63
147 if (ucobound(foo
,dim
=i
) /= 4) STOP 64