c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / interface_46.f90
blobc1d87638fbed25054199d9042ea3375fc3901806
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
7 integer, intent(in) :: a(:)
9 integer :: s(3)
11 s = [1, 2, 3]
12 return
13 end function cntf
15 program ice_p
17 implicit none
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
27 integer, parameter :: n = 9
29 integer :: arr(n)
31 integer :: s(3)
33 s = cntf(arr)
34 stop
36 end program ice_p