summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gfortran.dg/coarray/poly_run_3.f90
blob: 17a010844ebb59114b1f0b8f6af7c987872ed058 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
! { dg-do run }
!
! Check that the bounds of polymorphic coarrays is
! properly handled.
!
type t
end type t
class(t), allocatable :: a(:)[:]
class(t), allocatable :: b[:], d[:]

allocate(a(1)[*])
if (this_image() == 1 .and. any (this_image(a) /= lcobound(a))) &
  call abort ()
if (any (lcobound(a) /= 1)) call abort()
if (any (ucobound(a) /= this_image())) call abort ()
deallocate(a)

allocate(b[*])
if (this_image() == 1 .and. any (this_image(b) /= lcobound(b))) &
  call abort ()
if (any (lcobound(b) /= 1)) call abort()
if (any (ucobound(b) /= this_image())) call abort ()
deallocate(b)

allocate(a(1)[-10:*])
if (this_image() == 1 .and. any (this_image(a) /= lcobound(a))) &
  call abort ()
if (any (lcobound(a) /= -10)) call abort()
if (any (ucobound(a) /= -11+this_image())) call abort ()
deallocate(a)

allocate(d[23:*])
if (this_image() == 1 .and. any (this_image(d) /= lcobound(d))) &
  call abort ()
if (any (lcobound(d) /= 23)) call abort()
if (any (ucobound(d) /= 22+this_image())) call abort ()
deallocate(d)

end
OpenPOWER on IntegriCloud