Debian Codegraph @

gcc/testsuite/gfortran.dg/allocatable_dummy_3.f90

raw
1 ! { dg-do run }
2 ! PR 28416: Check that allocatable dummies can be passed onwards as non-assumed
3 ! shape arg.
4 program main
5
6 implicit none
7 integer, allocatable :: a(:)
8
9 interface
10 subroutine foo(v_out)
11 integer, allocatable :: v_out(:)
12 end subroutine foo
13 end interface
14
15 call foo(a)
16 if (any(a /= [ 1, 2, 3 ])) STOP 1
17
18 end program
19
20
21 subroutine foo(v_out)
22 implicit none
23 integer, allocatable :: v_out(:)
24
25 allocate(v_out(3))
26 call bar(v_out, size(v_out))
27 end subroutine foo
28
29
30 subroutine bar(v, N)
31 implicit none
32 integer :: N
33 integer :: v(N)
34 integer :: i
35
36 do i = 1, N
37 v(i) = i
38 end do
39 end subroutine bar