| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! PR fortran/18918 |
| 4 |
! |
| 5 |
! Check whether registering coarrays works |
| 6 |
! |
| 7 |
module m |
| 8 |
integer :: a(1)[*] = 7 |
| 9 |
end module m |
| 10 |
|
| 11 |
use m |
| 12 |
if (any (a /= 7)) STOP 1 |
| 13 |
a = 88 |
| 14 |
if (any (a /= 88)) STOP 2 |
| 15 |
|
| 16 |
block |
| 17 |
integer :: b[*] = 8494 |
| 18 |
if (b /= 8494) STOP 3 |
| 19 |
end block |
| 20 |
|
| 21 |
if (any (a /= 88)) STOP 4 |
| 22 |
call test () |
| 23 |
end |
| 24 |
|
| 25 |
subroutine test() |
| 26 |
real :: z[*] = sqrt(2.0) |
| 27 |
if (z /= sqrt(2.0)) STOP 5 |
| 28 |
call sub1() |
| 29 |
contains |
| 30 |
subroutine sub1 |
| 31 |
real :: r[4,*] = -1 |
| 32 |
if (r /= -1) STOP 1 |
| 33 |
r = 10 |
| 34 |
if (r /= 10) STOP 2 |
| 35 |
end subroutine sub1 |
| 36 |
|
| 37 |
subroutine uncalled() |
| 38 |
integer :: not_refed[2:*] = 784 |
| 39 |
if (not_refed /= 784) STOP 6 |
| 40 |
end subroutine uncalled |
| 41 |
end subroutine test |