used_types_5.f90
来自「用于进行gcc测试」· F90 代码 · 共 60 行
F90
60 行
! { dg-do compile }! Tests the fix for a further regression caused by the! fix for PR28788, as noted in reply #9 in the Bugzilla! entry by Martin Reinecke <martin@mpa-garching.mpg.de>.! The problem was caused by certain types of references! that point to a deleted derived type symbol, after the! type has been associated to another namespace. An! example of this is the specification expression for x! in subroutine foo below. At the same time, this tests! the correct association of typeaa between a module! procedure and a new definition of the type in MAIN.!module types type :: typea sequence integer :: i end type typea type :: typeaa sequence integer :: i end type typeaa type(typea) :: it = typea(2)end module types!------------------------------module global use types, only: typea, itcontains subroutine foo (x) use types type(typeaa) :: ca real :: x(it%i) common /c/ ca x = 42.0 ca%i = 99 end subroutine fooend module global!------------------------------ use global, only: typea, foo type :: typeaa sequence integer :: i end type typeaa type(typeaa) :: cam real :: x(4) common /c/ cam x = -42.0 call foo(x) if (any (x .ne. (/42.0, 42.0, -42.0, -42.0/))) call abort () if (cam%i .ne. 99) call abort ()end! { dg-final { cleanup-modules "types global" } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?