1! RUN: %S/test_errors.sh %s %t %flang_fc1
2! REQUIRES: shell
3! Test that NULLIFY works
4
5Module share
6  Real, Pointer :: rp
7  Procedure(Real), Pointer :: mprp
8End Module share
9
10Program nullifytest
11Use share
12
13INTEGER, PARAMETER :: maxvalue=1024
14
15Type dt
16  Integer :: l = 3
17End Type
18Type t
19  Type(dt),Pointer :: p
20End Type
21
22Type(t),Allocatable :: x(:)
23Type(t),Pointer :: y(:)
24Type(t),Pointer :: z
25
26Integer, Pointer :: pi
27Procedure(Real), Pointer :: prp
28
29Allocate(rp)
30Nullify(rp)
31
32Allocate(x(3))
33Nullify(x(2)%p)
34
35Nullify(y(2)%p)
36
37Nullify(pi)
38Nullify(prp)
39Nullify(mprp)
40
41Nullify(z%p)
42
43End Program
44