pr19928-2.f90

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

F90
24
字号
! Related to PR 19928.  Check that foo() is only called once per statement.! { dg-do run }program main  implicit none  type t    integer, dimension (5) :: field  end type t  type (t), dimension (2) :: a  integer :: calls, i, j  forall (i = 1:2, j = 1:5) a(i)%field(j) = i * 100 + j  calls = 0  if (sum (a%field(foo(calls))) .ne. 304) call abort  if (calls .ne. 1) call abort  if (sum (a(foo(calls))%field) .ne. 1015) call abort  if (calls .ne. 2) call abortcontains  function foo (calls)    integer :: calls, foo    calls = calls + 1    foo = 2  end function foo end program main

⌨️ 快捷键说明

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