Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_2.f90
blob98539b985af167891a2152650e4f3b55a45683ac
1 ! { dg-do compile }
3 ! checking invalid code for PROCEDURE POINTERS
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 PROCEDURE(REAL), POINTER :: ptr
8 PROCEDURE(REAL), SAVE :: noptr ! { dg-error "attribute conflicts with" }
9 REAL :: x
11 abstract interface
12 subroutine bar(a)
13 integer :: a
14 end subroutine bar
15 end interface
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" }
21 ptr => bar ! { dg-error "is invalid in procedure pointer assignment" }
23 ALLOCATE(ptr) ! { dg-error "must be ALLOCATABLE" }
25 end