| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! Test the fix for PR96728 |
| 4 |
! |
| 5 |
|
| 6 |
module cref_m |
| 7 |
|
| 8 |
implicit none |
| 9 |
|
| 10 |
private |
| 11 |
|
| 12 |
public :: & |
| 13 |
isub_a_m |
| 14 |
|
| 15 |
contains |
| 16 |
|
| 17 |
subroutine isub_a_m(a, b) |
| 18 |
integer, intent(in) :: a(..) |
| 19 |
integer, intent(out) :: b(size(a)) |
| 20 |
|
| 21 |
integer :: i |
| 22 |
|
| 23 |
b = [(i, i=1,size(b))] |
| 24 |
return |
| 25 |
end subroutine isub_a_m |
| 26 |
|
| 27 |
end module cref_m |
| 28 |
|
| 29 |
program cref_p |
| 30 |
|
| 31 |
use cref_m, only: & |
| 32 |
isub_a_m |
| 33 |
|
| 34 |
implicit none |
| 35 |
|
| 36 |
integer :: i |
| 37 |
|
| 38 |
integer, parameter :: n = 3 |
| 39 |
integer, parameter :: p(*) = [(i, i=1,n*n)] |
| 40 |
|
| 41 |
integer :: a(n,n) |
| 42 |
integer :: b(n*n) |
| 43 |
|
| 44 |
a = reshape(p, shape=[n,n]) |
| 45 |
call isub_a_m(a, b) |
| 46 |
if (any(b/=p)) stop 1 |
| 47 |
stop |
| 48 |
|
| 49 |
end program cref_p |