PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / warn_target_lifetime_3.f90
blob0ef1e2d19c7db754c8fcf446c90632951133de0c
1 ! { dg-do compile }
2 ! { dg-options "-Wall" }
4 ! PR fortran/55476
6 ! Contributed by Janus Weil
8 subroutine test
9 integer, pointer :: p
10 integer, target :: t
11 p => t
12 contains
13 subroutine sub() ! { dg-warning "defined but not used" }
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() ! { dg-warning "defined but not used" }
26 if (p2 /= 0) return
27 end subroutine
28 end subroutine
29 end module m