brintos

brintos / llvm-project-archived public Read only

0
0
Text · 575 B · f9a5e04 Raw
28 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12module m3  integer, target :: n4 contains5  function ptr()6    integer, pointer :: ptr7    ptr => n8  end9  subroutine s1(p)10    integer, pointer, intent(in) :: p11  end12  subroutine s2(p)13    integer, pointer, intent(in out) :: p14  end15end16 17program test18  use m19  integer, pointer :: p20  p => ptr() ! ok21  ptr() = 1 ! ok22  call s1(ptr()) ! ok23  call s1(null()) ! ok24  !ERROR: Actual argument associated with INTENT(IN OUT) dummy argument 'p=' is not definable25  !BECAUSE: 'ptr()' is not a definable pointer26  call s2(ptr())27end28