| 1 |
! { dg-do compile } |
| 2 |
! PR 94090 - this used to cause an ICE. |
| 3 |
! Test case by José Rui Faustino de Sousa. |
| 4 |
function cntf(a) result(s) |
| 5 |
implicit none |
| 6 |
|
| 7 |
integer, intent(in) :: a(:) |
| 8 |
|
| 9 |
integer :: s(3) |
| 10 |
|
| 11 |
s = [1, 2, 3] |
| 12 |
return |
| 13 |
end function cntf |
| 14 |
|
| 15 |
program ice_p |
| 16 |
|
| 17 |
implicit none |
| 18 |
|
| 19 |
interface |
| 20 |
function cntf(a) result(s) ! { dg-error "Rank mismatch in function result" } |
| 21 |
implicit none |
| 22 |
integer, intent(in) :: a(:) |
| 23 |
integer :: s ! (3) <- Ups! |
| 24 |
end function cntf |
| 25 |
end interface |
| 26 |
|
| 27 |
integer, parameter :: n = 9 |
| 28 |
|
| 29 |
integer :: arr(n) |
| 30 |
|
| 31 |
integer :: s(3) |
| 32 |
|
| 33 |
s = cntf(arr) |
| 34 |
stop |
| 35 |
|
| 36 |
end program ice_p |