3 ! Test the fix for PR96320 in which the assumed shape of 'arg' in the
4 ! interface for 'bar' was mirrored by the 'arg' in the module procedure
5 ! incorrectly have deferred shape.
7 ! Contributed by Damian Rouson <damian@sourceryinstitute.org>
12 procedure
, nopass
:: bar1
13 procedure
, nopass
:: bar2
14 procedure
, nopass
:: bar3
19 module subroutine bar1(arg
)
20 character(len
=*) arg(:)
23 module subroutine bar2(arg
)
24 character(len
=*) arg(3:)
27 module subroutine bar3(arg
)
28 character(len
=*) arg(2)
35 if (lbound(arg
, 1) .ne
. 1) stop 1
36 if (arg(3) .ne
. 'hijk') stop 2
39 ! Make sure that the lower bound of an assumed shape array dummy,
40 ! if defined, is passed to the module procedure.
43 if (lbound(arg
, 1) .ne
. 3) stop 3
44 if (arg(3) .ne
. 'abcd') stop 4
47 ! This makes sure that an dummy with explicit shape has the upper
48 ! bound correctly set in the module procedure.
51 if (lbound(arg
, 1) .ne
. 1) stop 5
52 if (arg(3) .ne
. 'hijk') stop 6 ! { dg-warning "is out of bounds" }
58 character(4) :: list(3) = ['abcd', 'efgh' , 'hijk']