mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:36:37 +00:00

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.
45 lines
525 B
Fortran
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
|