diff options
author | dominiq <dominiq@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-03 18:03:38 +0000 |
---|---|---|
committer | dominiq <dominiq@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-03 18:03:38 +0000 |
commit | ac7487f547090f41e325da0981d0d45e77e2282d (patch) | |
tree | 453830ae280054aad8d1baf6f1cfda8f06c2a0bc | |
parent | e3be0575db1ec7c36d91c1fda9e3735455cd0620 (diff) | |
download | gcc-ac7487f547090f41e325da0981d0d45e77e2282d.tar.gz |
2015-11-03 Dominique d'Humieres <dominiq@lps.ens.fr>
PR fortran/67982
* gfortran.dg/warn_unused_function_3.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229716 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/warn_unused_function_3.f90 | 35 |
2 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 14253d1d1b3..829e0a8f500 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-03 Dominique d'Humieres <dominiq@lps.ens.fr> + + PR fortran/67982 + * gfortran.dg/warn_unused_function_3.f90: New test. + 2015-11-03 Eric Botcazou <ebotcazou@adacore.com> * gnat.dg/discr45.adb: Only compile the test. diff --git a/gcc/testsuite/gfortran.dg/warn_unused_function_3.f90 b/gcc/testsuite/gfortran.dg/warn_unused_function_3.f90 new file mode 100644 index 00000000000..63d64ffc7ac --- /dev/null +++ b/gcc/testsuite/gfortran.dg/warn_unused_function_3.f90 @@ -0,0 +1,35 @@ +! { dg-do compile } +! { dg-options "-Wunused-function" } +! +! PR 67982: Bogus -Wunused-function warning with contained function +! +! Contributed by Joost VandeVondele <Joost dot VandeVondele at mat dot ethz dot ch> + +MODULE base + INTERFACE + SUBROUTINE bar_int() + END SUBROUTINE + END INTERFACE + PUBLIC hook + PRIVATE + PROCEDURE(bar_int), POINTER :: hook=>NULL() +END MODULE base + +MODULE foo + USE base, ONLY: hook + PUBLIC init + PRIVATE +CONTAINS + SUBROUTINE init() + hook=>bar + END SUBROUTINE init + SUBROUTINE bar() + WRITE(6,*) "In bar" + END SUBROUTINE +END MODULE + +USE foo, ONLY: init +USE base, ONLY: hook +CALL init() +CALL hook() +END |