f18-llvm-project icon indicating copy to clipboard operation
f18-llvm-project copied to clipboard

Enable calling procedures declared in an outer scope

Open psteinfeld opened this issue 3 years ago • 0 comments

We do not currently handle the case where an internal procedure calls a procedure whose name is declared in an outer scope. Here's an example program:

PROGRAM call_outer
  INTRINSIC amod
  CALL outer(amod)
END
SUBROUTINE outer(mod)
  REAL,EXTERNAL :: mod
  real :: result

  result = inner()

CONTAINS
  FUNCTION inner()
    REAL inner
    inner = mod(3.0, 4.0) ! mod is declared in "outer"
  END FUNCTION
END subroutine

psteinfeld avatar Nov 02 '21 15:11 psteinfeld