f2c_6.f90

来自「用于进行gcc测试」· F90 代码 · 共 85 行

F90
85
字号
! { dg-do run }! { dg-options "-ff2c" }! Verifies that complex pointer results work with -ff2c! try all permutations of result clause in function yes/no!                     and result clause in interface yes/no! this is not possible in Fortran 77, but this exercises a previously! buggy codepathfunction c() result (r)  common // z  complex, pointer :: r  complex, target :: z  r=>zend function cfunction d()  common // z  complex, pointer :: d  complex, target :: z  d=>zend function dfunction e()  common // z  complex, pointer :: e  complex, target :: z  e=>zend function efunction f() result(r)  common // z  complex, pointer :: r  complex, target :: z  r=>zend function finterface   function c ()     complex, pointer :: c   end function cend interfaceinterface   function d()     complex, pointer :: d   end function dend interfaceinterface   function e () result(r)     complex, pointer :: r   end function eend interfaceinterface   function f () result(r)     complex, pointer :: r   end function fend interfacecommon // zcomplex, target :: zcomplex, pointer :: pz = (1.,0.)p => c()z = (2.,0.)if (p /= z) call abort ()NULLIFY(p)p => d()z = (3.,0.)if (p /= z) call abort ()NULLIFY(p)p => e()z = (4.,0.)if (p /= z) call abort ()NULLIFY(p)p => f()z = (5.,0.)if (p /= z) call abort ()end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?