llvm-project/flang/test/Semantics/implicit17.f90
Eugene Epshteyn 642288247d
[flang] Add support for -fimplicit-none-ext option (#125248)
When -fimplicit-none-ext is passed, flang behaves as if "implicit
none(external)" was specified for all relevant constructs in Fortran
source file.

Note: implicit17.f90 was based on implicit07.f90 with `implicit
none(external)` removed and `-fimplicit-none-ext` added.
2025-02-04 20:50:01 -05:00

15 lines
512 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1 -fimplicit-none-ext
external x
integer :: f, i, arr(1) = [0]
call x
!ERROR: 'y' is an external procedure without the EXTERNAL attribute in a scope with IMPLICIT NONE(EXTERNAL)
call y
!ERROR: 'f' is an external procedure without the EXTERNAL attribute in a scope with IMPLICIT NONE(EXTERNAL)
i = f()
block
!ERROR: 'z' is an external procedure without the EXTERNAL attribute in a scope with IMPLICIT NONE(EXTERNAL)
call z
end block
print *, arr(1) ! no error
end