Debian Codegraph @

gcc/testsuite/gfortran.dg/coarray_allocate_2.f08

raw
1 ! { dg-do run }
2 ! { dg-options "-fcoarray=single" }
3 !
4 ! Contributed by Ian Harvey <[email protected]>
5 ! Extended by Andre Vehreschild <[email protected]>
6 ! to test that coarray references in allocate work now
7 ! PR fortran/67451
8
9 program main
10 implicit none
11 type foo
12 integer :: bar = 99
13 end type
14 class(foo), allocatable :: foobar[:]
15 class(foo), allocatable :: some_local_object
16 allocate(foobar[*])
17
18 allocate(some_local_object, source=foobar)
19
20 if (.not. allocated(foobar)) STOP 1
21 if (.not. allocated(some_local_object)) STOP 2
22
23 deallocate(some_local_object)
24 deallocate(foobar)
25 end program
26