| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! Tests the fix for PR89364, in which the ubound and the last element of |
| 4 |
! shape were note returning -1 for assumed rank entities, argument |
| 5 |
! associated with assumed size dummies. |
| 6 |
! |
| 7 |
! Contributed by Reinhold Bader <[email protected]> |
| 8 |
! |
| 9 |
module mod_ass_rank_04 |
| 10 |
implicit none |
| 11 |
contains |
| 12 |
subroutine si(this) |
| 13 |
real :: this(4, *) |
| 14 |
call sa(this) |
| 15 |
end subroutine si |
| 16 |
subroutine sa(this) |
| 17 |
real :: this(..) |
| 18 |
if (rank(this) /= 2) then |
| 19 |
stop 1 |
| 20 |
end if |
| 21 |
if (maxval(abs(shape(this) - [4,-1])) > 0) then |
| 22 |
stop 2 |
| 23 |
end if |
| 24 |
if (ubound(this,2) /= lbound(this,2) - 2) then |
| 25 |
stop 3 |
| 26 |
end if |
| 27 |
end subroutine sa |
| 28 |
end module mod_ass_rank_04 |
| 29 |
program ass_rank_04 |
| 30 |
use mod_ass_rank_04 |
| 31 |
implicit none |
| 32 |
real :: y(9) |
| 33 |
call si(y(2)) |
| 34 |
end program ass_rank_04 |