2 ! { dg-options "-std=f2003 -fall-intrinsics" }
5 ! Test PROTECTED attribute. Within the module everything is allowed.
6 ! Outside (use-associated): For pointers, their association status
7 ! may not be changed. For nonpointers, their value may not be changed.
13 integer, protected :: a
14 integer, protected, target :: at
15 integer, protected, pointer :: ap
25 call increment(a,ap,at)
26 if(a /= 44 .or. ap /= 74 .or. at /= 4) call abort()
27 end subroutine setValue
28 subroutine increment(a1,a2,a3)
29 integer, intent(inout) :: a1, a2, a3
33 end subroutine increment
40 if(a /= 44 .or. ap /= 74 .or. at /= 4) call abort()
42 if(a /= 44 .or. ap /= 79 .or. at /= 4) call abort()
43 call checkVal(a,ap,at)
46 integer, intent(inout) :: j
49 subroutine checkVal(x,y,z)
50 integer, intent(in) :: x, y, z
51 if(a /= 44 .or. ap /= 79 .or. at /= 4) call abort()
55 ! { dg-final { cleanup-modules "protmod" } }