| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! Test the fix for PR96727 |
| 4 |
! |
| 5 |
|
| 6 |
program cref_p |
| 7 |
|
| 8 |
implicit none |
| 9 |
|
| 10 |
integer :: i |
| 11 |
|
| 12 |
integer, parameter :: n = 3 |
| 13 |
integer, parameter :: p(*) = [(i, i=1,n*n)] |
| 14 |
character(len=*), parameter :: q = repeat('a', n*n) |
| 15 |
|
| 16 |
integer :: a(n,n) |
| 17 |
character(len=n*n) :: c |
| 18 |
|
| 19 |
a = reshape(p, shape=[n,n]) |
| 20 |
call csub(a, c) |
| 21 |
if (c/=q) stop 1 |
| 22 |
stop |
| 23 |
|
| 24 |
contains |
| 25 |
|
| 26 |
subroutine csub(a, b) |
| 27 |
integer, intent(in) :: a(..) |
| 28 |
character(len=size(a)), intent(out) :: b |
| 29 |
|
| 30 |
b = repeat('a', len(b)) |
| 31 |
return |
| 32 |
end subroutine csub |
| 33 |
|
| 34 |
end program cref_p |