PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_comp_pass_4.f90
blob1632e2748218557740c2af03529838def4e84334
1 ! { dg-do compile }
3 ! PR 39630: [F03] Procedure Pointer Components with PASS
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 module m
9 type :: t0
10 procedure() :: p0 ! { dg-error "POINTER attribute is required for procedure pointer component" }
11 end type
13 type :: t1
14 integer :: i
15 procedure(foo1), pointer :: f1 ! { dg-error "must be scalar" }
16 end type
18 type :: t2
19 integer :: i
20 procedure(foo2), pointer :: f2 ! { dg-error "may not have the POINTER attribute" }
21 end type
23 type :: t3
24 integer :: i
25 procedure(foo3), pointer :: f3 ! { dg-error "may not be ALLOCATABLE" }
26 end type
28 type :: t4
29 procedure(), pass(x), pointer :: f4 ! { dg-error "NOPASS or explicit interface required" }
30 procedure(real), pass(y), pointer :: f5 ! { dg-error "NOPASS or explicit interface required" }
31 procedure(foo6), pass(c), pointer :: f6 ! { dg-error "has no argument" }
32 end type
34 type :: t7
35 procedure(foo7), pass, pointer :: f7 ! { dg-error "must have at least one argument" }
36 end type
38 type :: t8
39 procedure(foo8), pass, pointer :: f8 ! { dg-error "must be of the derived type" }
40 procedure(foo9), pass, pointer :: f9 ! { dg-error "Non-polymorphic passed-object dummy argument" }
41 end type
43 contains
45 subroutine foo1 (x1,y1)
46 class(t1) :: x1(:)
47 type(t1) :: y1
48 end subroutine
50 subroutine foo2 (x2,y2)
51 class(t2),pointer :: x2
52 type(t2) :: y2
53 end subroutine
55 subroutine foo3 (x3,y3)
56 class(t3),allocatable :: x3
57 type(t3) :: y3
58 end subroutine
60 real function foo6 (a,b)
61 real :: a,b
62 foo6 = 1.
63 end function
65 integer function foo7 ()
66 foo7 = 2
67 end function
69 character function foo8 (i)
70 integer :: i
71 end function
73 subroutine foo9(x)
74 type(t8) :: x
75 end subroutine
77 end module m