This test is taken from, http://ftp.cac.psu.edu/pub/ger/fortran/test/test10.for
$ cat test.f90
INTEGER X, Y, SUBA
EXTERNAL SUBA
X=-1
Y=-2
CALL ANY(SUBA,X,Y)
WRITE(*,*)'Did NOT catch this error'
PAUSE
STOP
END
SUBROUTINE ANY(FNC,X,Y)
INTEGER Y,X, FNC
!---FNC is not a Function subprogram so calling it
! as a function is an error.
Y=FNC(X)
RETURN
END
SUBROUTINE SUBA(X)
INTEGER X
X=12345
RETURN
END
$ gfrotran test.f90
$ ./a.out
in suba
Did NOT catch this error
PAUSE
To resume execution, type go. Other input will terminate the job.
go
RESUMED
In this test case, a subroutine SUBA is getting called as a function which
should have been caught at runtime.
--
Summary: subroutine getting called illegally as a function
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: uttamp at us dot ibm dot com
GCC build triplet: powerpc64-linux
GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24878