func_derived_1.f90
来自「用于进行gcc测试」· F90 代码 · 共 41 行
F90
41 行
! { dg-do run }! PR 17244! verifies that functions returning derived type workmodule m type t integer i real x character*5 c integer arr(5,5) end type tend module muse mtype(t) :: rinteger arr(5,5), vect(25), vect2(25)do i=1,25 vect = 0 vect(i) = i arr = reshape (vect, shape(arr)) r = f(i,real(i),"HALLO",arr) if (r%i .ne. i) call abort() if (r%x .ne. real(i)) call abort() if (r%c .ne. "HALLO") call abort() vect2 = reshape (r%arr, shape(vect2)) if (any(vect2.ne.vect)) call abort()end docontainsfunction f(i,x,c,arr) type(t) :: f character*5 c integer arr(5,5) f = t(i,x,c,arr)end function fend! { dg-final { cleanup-modules "m" } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?