Debian Codegraph @

gcc/testsuite/gfortran.dg/coarray/ptr_comp_6.f08

raw
1 !{ dg-do run }
2 !
3 ! Contributed by Arseny Solokha <[email protected]>
4
5 program pr104684
6 type :: index_map
7 integer, allocatable :: send_index(:)
8 end type
9 type(index_map) :: imap
10
11 imap%send_index = [5,4,3]
12 call sub(imap)
13 contains
14 subroutine sub(this)
15 type(index_map), intent(inout), target :: this
16 type :: box
17 integer, pointer :: array(:)
18 end type
19 type(box), allocatable :: buffer[:]
20 allocate(buffer[*])
21 buffer%array => this%send_index
22 if (any(buffer%array /= [5,4,3])) stop 1
23 end subroutine
24 end program
25