URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [pointer_check_3.f90] - Rev 302
Compare with Previous | Blame | View Log
! { dg-do run }! { dg-options "-fcheck=pointer" }! { dg-shouldfail "Unassociated/unallocated actual argument" }!! { dg-output ".*At line 61.*Pointer actual argument 'ptr2' is not associated" }!! PR fortran/40580!! Run-time check of passing deallocated/nonassociated actuals! to nonallocatable/nonpointer dummies.!! Check for variable actuals!subroutine test1(a)integer :: aa = 4444end subroutine test1subroutine test2(a)integer :: a(2)a = 4444end subroutine test2subroutine ppTest(f)implicit noneexternal fcall f()end subroutine ppTestProgram RunTimeCheckimplicit noneexternal :: test1, test2, ppTestinteger, pointer :: ptr1, ptr2(:)integer, allocatable :: alloc2(:)procedure(), pointer :: pptrallocate(ptr1,ptr2(2),alloc2(2))pptr => sub! OKcall test1(ptr1)call test3(ptr1)call test2(ptr2)call test2(alloc2)call test4(ptr2)call test4(alloc2)call ppTest(pptr)call ppTest2(pptr)! Invalid 1:deallocate(alloc2)! call test2(alloc2)! call test4(alloc2)! Invalid 2:deallocate(ptr1,ptr2)nullify(ptr1,ptr2)! call test1(ptr1)! call test3(ptr1)call test2(ptr2)! call test4(ptr2)! Invalid 3:nullify(pptr)! call ppTest(pptr)call ppTest2(pptr)containssubroutine test3(b)integer :: bb = 333end subroutine test3subroutine test4(b)integer :: b(2)b = 333end subroutine test4subroutine sub()print *, 'Hello World'end subroutine subsubroutine ppTest2(f)implicit noneprocedure(sub) :: fcall f()end subroutine ppTest2end Program RunTimeCheck
