1! { dg-do compile } 2! 3! checking invalid code for PROCEDURE POINTERS 4! 5! Contributed by Janus Weil <janus@gcc.gnu.org> 6 7PROCEDURE(REAL), POINTER :: ptr 8PROCEDURE(REAL), SAVE :: noptr ! { dg-error "attribute conflicts with" } 9REAL :: x 10 11 abstract interface 12 subroutine bar(a) 13 integer :: a 14 end subroutine bar 15 end interface 16 17ptr => cos(4.0) ! { dg-error "Invalid procedure pointer assignment" } 18ptr => x ! { dg-error "Invalid procedure pointer assignment" } 19ptr => sin(x) ! { dg-error "Invalid procedure pointer assignment" } 20 21ptr => bar ! { dg-error "is invalid in procedure pointer assignment" } 22 23ALLOCATE(ptr) ! { dg-error "must be ALLOCATABLE" } 24 25end 26