2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / warn_target_lifetime_3.f90
blob9113a885fa6b4f4b0e511815ee12dbd0201f77ae
1 ! { dg-do compile }
2 ! { dg-options "-Wall" }
4 ! PR fortran/55476
6 ! Contribued by Janus Weil
8 subroutine test
9 integer, pointer :: p
10 integer, target :: t
11 p => t
12 contains
13 subroutine sub()
14 if (p /= 0) return
15 end subroutine
16 end subroutine
18 module m
19 integer, pointer :: p2
20 contains
21 subroutine test
22 integer, target :: t2
23 p2 => t2 ! { dg-warning "Pointer at .1. in pointer assignment might outlive the pointer target" }
24 contains
25 subroutine sub()
26 if (p2 /= 0) return
27 end subroutine
28 end subroutine
29 end module m