annotate gcc/testsuite/gfortran.dg/pure_formal_3.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 !
kono
parents:
diff changeset
3 ! Clean up, made when working on PR fortran/52864
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 ! Test some PURE and intent checks - related to pointers.
kono
parents:
diff changeset
6 module m
kono
parents:
diff changeset
7 type t
kono
parents:
diff changeset
8 end type t
kono
parents:
diff changeset
9 integer, pointer :: x
kono
parents:
diff changeset
10 class(t), pointer :: y
kono
parents:
diff changeset
11 end module m
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 pure subroutine foo()
kono
parents:
diff changeset
14 use m
kono
parents:
diff changeset
15 call bar(x) ! { dg-error "can not appear in a variable definition context" }
kono
parents:
diff changeset
16 call bar2(x) ! { dg-error "is local to a PURE procedure and has the POINTER attribute" }
kono
parents:
diff changeset
17 call bb(y) ! { dg-error "is local to a PURE procedure and has the POINTER attribute" }
kono
parents:
diff changeset
18 contains
kono
parents:
diff changeset
19 pure subroutine bar(x)
kono
parents:
diff changeset
20 integer, pointer, intent(inout) :: x
kono
parents:
diff changeset
21 end subroutine
kono
parents:
diff changeset
22 pure subroutine bar2(x)
kono
parents:
diff changeset
23 integer, pointer :: x
kono
parents:
diff changeset
24 end subroutine
kono
parents:
diff changeset
25 pure subroutine bb(x)
kono
parents:
diff changeset
26 class(t), pointer, intent(in) :: x
kono
parents:
diff changeset
27 end subroutine
kono
parents:
diff changeset
28 end subroutine