Debian Codegraph @

gcc/testsuite/gfortran.dg/coarray/poly_run_1.f90

raw
1 ! { dg-do run }
2 !
3 ! Test for polymorphic coarrays
4 !
5 type t
6 end type t
7 class(t), allocatable :: A(:)[:,:]
8 allocate (A(2)[1:4,-5:*])
9 if (any (lcobound(A) /= [1, -5])) STOP 1
10 if (num_images() == 1) then
11 if (any (ucobound(A) /= [4, -5])) STOP 2
12 else
13 if (ucobound(A,dim=1) /= 4) STOP 3
14 end if
15 if (allocated(A)) i = 5
16 call s(A)
17 call st(A) ! FIXME
18
19 contains
20
21 subroutine s(x)
22 class(t),allocatable :: x(:)[:,:]
23 if (any (lcobound(x) /= [1, -5])) STOP 4
24 if (num_images() == 1) then
25 if (any (ucobound(x) /= [4, -5])) STOP 5
26 else
27 if (ucobound(x,dim=1) /= 4) STOP 6
28 end if
29 end subroutine s
30
31 subroutine st(x)
32 class(t) :: x(:)[4,2:*]
33 if (any (lcobound(x) /= [1, 2])) STOP 7
34 if (lcobound(x, dim=1) /= 1) STOP 8
35 if (lcobound(x, dim=2) /= 2) STOP 9
36 if (this_image() == 1) then
37 if (any (this_image(x) /= lcobound(x))) STOP 10
38 if (this_image(x, dim=1) /= lcobound(x, dim=1)) STOP 11
39 if (this_image(x, dim=2) /= lcobound(x, dim=2)) STOP 12
40 end if
41 if (num_images() == 1) then
42 if (any (ucobound(x) /= [4, 2])) STOP 13
43 if (ucobound(x, dim=1) /= 4) STOP 14
44 if (ucobound(x, dim=2) /= 2) STOP 15
45 else
46 if (ucobound(x,dim=1) /= 4) STOP 16
47 end if
48 end subroutine st
49 end
50