7 type(t), save :: obj[*]
8 integer, allocatable, target :: i[:]
10 if (associated(obj%z)) error stop "'z' should not be associated yet."
13 if (associated(obj%z)) error stop "'z' should not be associated anymore."
15 allocate(i[*], SOURCE=42)
17 if (.not. allocated(i)) error stop "'i' no longer allocated."
19 if (obj%z /= 15) error stop "'obj%z' is deep copy and not pointer."
22 if (.not. allocated(i)) error stop "'i' should still be allocated."
23 if (associated(obj%z)) error stop "'obj%z' should not be associated anymore."
27 ! One can not say anything about i here. The memory should be deallocated, but
28 ! the pointer in i is still set.
29 if (associated(obj%z)) error stop "'obj%z' should not be associated anymore."
33 if ( associated(x%z) ) deallocate(x%z)