OSDN Git Service

PR debug/43329
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / proc_ptr_14.f90
1 ! { dg-do compile }
2 ! { dg-options "-std=f95" }
3 !
4 ! PR 39692: f95: conflict between EXTERNAL and POINTER
5 !
6 ! Test for Procedure Pointers (without PROCEDURE statements) with the -std=f95 flag.
7 !
8 ! Contributed by Janus Weil <janus@gcc.gnu.org>
9
10 pointer :: f
11 external :: f   ! { dg-error "Fortran 2003: Procedure pointer" }
12
13 external :: g
14 pointer :: g   ! { dg-error "Fortran 2003: Procedure pointer" }
15
16 real, pointer, external :: h   ! { dg-error "Fortran 2003: Procedure pointer" }
17
18 interface
19   subroutine i
20   end subroutine i
21 end interface
22 pointer :: i   ! { dg-error "Fortran 2003: Procedure pointer" }
23
24 pointer :: j
25 interface
26   real function j()
27   end function j   ! { dg-error "Fortran 2003: Procedure pointer" }
28 end interface
29
30 contains
31
32   function k()   ! { dg-error "attribute conflicts with" }
33     intrinsic sin
34     external k
35     pointer k   ! { dg-error "Fortran 2003: Procedure pointer" }
36     real k
37   end function k
38
39 end
40