2 ! Tests the fix for pr28660 in which the order of dependent declarations
3 ! would get scrambled in the compiled code.
5 ! Contributed by Erik Edelmann <erik.edelmann@iki.fi>
14 subroutine foo1 (xmin)
15 real, intent(inout) :: xmin(:)
16 real :: x(size(xmin)+1) ! The declaration for r would be added
17 real :: r(size(x)-2) ! to the function before that of x
19 if (size(r) .ne. 9) call abort ()
20 if (size(x) .ne. 11) call abort ()
22 subroutine foo2 (xmin) ! This version was OK because of the
23 real, intent(inout) :: xmin(:) ! renaming of r which pushed it up
24 real :: x(size(xmin)+3) ! the symtree.
27 if (size(zr) .ne. 7) call abort ()
28 if (size(x) .ne. 13) call abort ()
30 subroutine foo3 (xmin)
31 real, intent(inout) :: xmin(:)
32 character(size(x)+2) :: y ! host associated x
33 character(len(y)+3) :: z ! This did not work for any combination
34 real :: r(len(z)-10) ! of names.
36 if (size(r) .ne. 5) call abort ()
37 if (len(z) .ne. 15) call abort ()