view gcc/testsuite/gfortran.dg/pointer_check_10.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 "-fcheck=all -std=f2003 -fall-intrinsics" }
! { dg-shouldfail "Pointer actual argument 'ptr' is not associated" }
!
! PR fortran/49255
!
! Valid F2008, invalid F95/F2003.
!
integer,pointer :: ptr => null()
call foo (ptr)
contains
  subroutine foo (x)
    integer, optional :: x
    if (present (x)) call abort ()
  end subroutine foo
end