OSDN Git Service

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