From 11c7f78838d7587f95e28e6cbf4695a02c37d842 Mon Sep 17 00:00:00 2001 From: Dominique d'Humieres Date: Fri, 6 Nov 2015 22:49:18 +0100 Subject: [PATCH] re PR fortran/54224 (Warn for unused internal procedures) 2015-11-06 Dominique d'Humieres PR fortran/54224 * gfortran.dg/warn_unused_function_2.f90: Add two new "defined but not used" subroutines. From-SVN: r229894 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gfortran.dg/warn_unused_function_2.f90 | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 725273be541..774981c21a9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-11-06 Dominique d'Humieres + + PR fortran/54224 + * gfortran.dg/warn_unused_function_2.f90: Add two new + "defined but not used" subroutines. + 2015-11-06 Jakub Jelinek * gcc.dg/gomp/ordered-2.c (f1): Expect an extra error. diff --git a/gcc/testsuite/gfortran.dg/warn_unused_function_2.f90 b/gcc/testsuite/gfortran.dg/warn_unused_function_2.f90 index 8d65dabef89..958cc969253 100644 --- a/gcc/testsuite/gfortran.dg/warn_unused_function_2.f90 +++ b/gcc/testsuite/gfortran.dg/warn_unused_function_2.f90 @@ -2,6 +2,7 @@ ! { dg-options "-Wall" } ! ! [4.8 Regression] PR 54997: -Wunused-function gives false warnings +! PR 54224: missing warnings with -Wunused-function ! ! Contributed by Janus Weil @@ -14,6 +15,9 @@ contains subroutine s1 ! { dg-warning "defined but not used" } call s2(s3) + contains + subroutine s4 ! { dg-warning "defined but not used" } + end subroutine end subroutine subroutine s2(dummy) ! { dg-warning "Unused dummy argument" } @@ -30,5 +34,10 @@ subroutine sub entry en end subroutine +program test +contains + subroutine s5 ! { dg-warning "defined but not used" } + end subroutine +end ! { dg-final { cleanup-modules "m" } } -- 2.30.2