cray_pointers_7.f90
来自「用于进行gcc测试」· F90 代码 · 共 44 行
F90
44 行
! { dg-do run }! { dg-options "-fcray-pointer" }! Test the implementation of Cray pointers to procedures.program cray_pointers_7 implicit none integer tmp integer, external :: fn external sub ! We can't mix function and subroutine pointers. pointer (subptr,subpte) pointer (fnptr,fnpte) ! Declare pointee types. external subpte integer, external :: fnpte tmp = 0 ! Check pointers to subroutines. subptr = loc(sub) call subpte(tmp) if (tmp .ne. 17) call abort() ! Check pointers to functions. fnptr = loc(fn) tmp = fnpte(7) if (tmp .ne. 14) call abort() end program cray_pointers_7! Trivial subroutine to be called through a Cray pointer.subroutine sub(i) integer i i = 17end subroutine sub! Trivial function to be called through a Cray pointer.function fn(i) integer fn,i fn = 2*iend function fn
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?