48 lines · plain
1! RUN: %python %S/test_symbols.py %s %flang_fc12! Test handling of pernicious case in which it is conformant Fortran3! to use the name of a function in a CALL statement. Almost all4! other compilers produce bogus errors for this case and/or crash.5 6!DEF: /m Module7module m8contains9 !DEF: /m/foo PUBLIC (Function) Subprogram10 function foo()11 !DEF: /m/bar PUBLIC (Subroutine) Subprogram12 !DEF: /m/foo/foo EXTERNAL, POINTER (Subroutine) ProcEntity13 procedure(bar), pointer :: foo14 !REF: /m/bar15 !DEF: /m/foo/baz EXTERNAL, POINTER (Subroutine) ProcEntity16 procedure(bar), pointer :: baz17 !REF: /m/foo/foo18 !REF: /m/bar19 foo => bar20 !REF: /m/foo/foo21 call foo22 !DEF: /m/baz PUBLIC (Function) Subprogram23 entry baz()24 !REF: /m/foo/baz25 !REF: /m/bar26 baz => bar27 !REF: /m/foo/baz28 call baz29 end function30 !REF: /m/bar31 subroutine bar32 print *, "in bar"33 end subroutine34end module35!DEF: /DEMO MainProgram36program DEMO37 !REF: /m38 use :: m39 !DEF: /DEMO/bar (Subroutine) Use40 !DEF: /DEMO/p EXTERNAL, POINTER (Subroutine) ProcEntity41 procedure(bar), pointer :: p42 !REF: /DEMO/p43 !DEF: /DEMO/foo (Function) Use44 p => foo()45 !REF: /DEMO/p46 call p47end program48