Files
clang-p2996/flang/test/Semantics/symbol24.f90
Peter Klausler 4c9d54982c [flang] Special handling of ENTRY BIND(C,NAME=...)
We apply special symbol table scoping to top-level subroutine
and function names that have interoperable binding names, so
that it's possible to define the same subroutine/function name
more than once at the top level so long as their binding names
are distinct.  But we don't use those scoping techniques for
ENTRY statement symbols with interoperable binding names,
which can lead to bogus semantic errors when the same ENTRY
name is defined multiple times with distinct binding names.

Differential Revision: https://reviews.llvm.org/D134401
2022-09-23 11:01:17 -07:00

21 lines
600 B
Fortran

! RUN: %python %S/test_symbols.py %s %flang_fc1
! Ensure that global ENTRY symbols with global bindings
! are hidden in distinct global scopes, and nothing
! clashes so long as binding names are distinct.
!DEF: /s1 (Subroutine) Subprogram
subroutine s1
!DEF: /foo (Subroutine) Subprogram
entry foo()
end subroutine
!DEF: /s2 (Subroutine) Subprogram
subroutine s2
!DEF: /foo BIND(C) (Subroutine) Subprogram
entry foo() bind(c, name="foo1")
end subroutine
!DEF: /s3 (Subroutine) Subprogram
subroutine s3
!DEF: /foo BIND(C) (Subroutine) Subprogram
entry foo() bind(c, name="foo2")
end subroutine