summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/warn_unused_function_2.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/warn_unused_function_2.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/warn_unused_function_2.f9034
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/warn_unused_function_2.f90 b/gcc/testsuite/gfortran.dg/warn_unused_function_2.f90
new file mode 100644
index 0000000000..8d65dabef8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/warn_unused_function_2.f90
@@ -0,0 +1,34 @@
+! { dg-do compile }
+! { dg-options "-Wall" }
+!
+! [4.8 Regression] PR 54997: -Wunused-function gives false warnings
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+module m
+
+ implicit none
+ private :: s1,s2,s3
+
+contains
+
+ subroutine s1 ! { dg-warning "defined but not used" }
+ call s2(s3)
+ end subroutine
+
+ subroutine s2(dummy) ! { dg-warning "Unused dummy argument" }
+ procedure() :: dummy
+ end subroutine
+
+ subroutine s3()
+ end subroutine
+
+end module
+
+
+subroutine sub
+entry en
+end subroutine
+
+
+! { dg-final { cleanup-modules "m" } }