gcc/fortran/
[official-gcc.git] / gcc / testsuite / gfortran.dg / warn_unused_function_3.f90
blob63d64ffc7ac155e7ecfa7ca7fdcdda22d0abb63a
1 ! { dg-do compile }
2 ! { dg-options "-Wunused-function" }
4 ! PR 67982: Bogus -Wunused-function warning with contained function
6 ! Contributed by Joost VandeVondele <Joost dot VandeVondele at mat dot ethz dot ch>
8 MODULE base
9 INTERFACE
10 SUBROUTINE bar_int()
11 END SUBROUTINE
12 END INTERFACE
13 PUBLIC hook
14 PRIVATE
15 PROCEDURE(bar_int), POINTER :: hook=>NULL()
16 END MODULE base
18 MODULE foo
19 USE base, ONLY: hook
20 PUBLIC init
21 PRIVATE
22 CONTAINS
23 SUBROUTINE init()
24 hook=>bar
25 END SUBROUTINE init
26 SUBROUTINE bar()
27 WRITE(6,*) "In bar"
28 END SUBROUTINE
29 END MODULE
31 USE foo, ONLY: init
32 USE base, ONLY: hook
33 CALL init()
34 CALL hook()
35 END