Files
clang-p2996/flang/test/Semantics/declarations04.f90
Peter Klausler 1c900ed373 [flang] Catch error: COMMON block and implicit interface external subprogram with same name
Declaration checking catches the error of a COMMON block and a subprogram
definition having the same name, but misses the case of a COMMON block
and an a reference to an external subprogram with an implicit interface.
Fix.  Fixes bug https://github.com/llvm/llvm-project/issues/63247.

Differential Revision: https://reviews.llvm.org/D153786
2023-06-27 13:18:30 -07:00

32 lines
619 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
! test global name conflicts
subroutine ext1
end
subroutine ext2
!ERROR: Two entities have the same global name 'ext1'
common /ext1/ x
end
module ext4
contains
!ERROR: Two entities have the same global name 'ext2'
subroutine foo() bind(c,name="ext2")
end
!ERROR: Two entities have the same global name 'ext3'
subroutine bar() bind(c,name="ext3")
end
end
block data ext3
!PORTABILITY: Global name 'ext4' conflicts with a module
common /ext4/ x
end
subroutine s
!ERROR: Two entities have the same global name 'foo'
common /foo/n
call foo
end