Peter Klausler 8be575e498
[flang] Fix edge case regression (#109350)
A recent fix to the emission of derived type names to module files
exposed a regression in the case of a derived type that (1) has the same
name as a generic procedure interface and (2) has undergone renaming
through USE association before (3) being used in a declaration
significant to a module procedure interface. Fix.
2024-09-20 13:53:33 -07:00

45 lines
525 B
Fortran

! RUN: %python %S/test_modfile.py %s %flang_fc1
module m1
type foo
end type
interface foo
end interface
end
!Expect: m1.mod
!module m1
!type::foo
!end type
!interface foo
!end interface
!end
module m2
use m1, only: bar => foo
end
!Expect: m2.mod
!module m2
!use m1,only:bar=>foo
!use m1,only:bar=>foo
!interface bar
!end interface
!end
module m3
contains
subroutine sub(x)
use m2
type(bar) x
end
end
!Expect: m3.mod
!module m3
!contains
!subroutine sub(x)
!use m2,only:bar
!type(bar)::x
!end
!end