view gcc/testsuite/gfortran.dg/f2c_3.f90 @ 128:fe568345ddd5

fix CbC-example
author mir3636
date Wed, 11 Apr 2018 19:32:28 +0900
parents 04ced10e8804
children 84e7813d76e9
line wrap: on
line source

! { dg-do run }
! { dg-options "-ff2c" }
! Verifies that internal functions are not broken by f2c calling conventions
program test
  real, target :: f
  real, pointer :: q
  real :: g
  f = 1.0
  q=>f
  g = foo(q)
  if (g .ne. 1.0) call abort
contains
function foo (p)
  real, pointer :: foo
  real, pointer :: p
  foo => p
end function
end program