aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDominique d'Humieres <dominiq@lps.ens.fr>2015-11-13 11:58:53 +0100
committerDominique d'Humieres <dominiq@gcc.gnu.org>2015-11-13 11:58:53 +0100
commit755fdaab8ed0d1c1f954c21a2a4a8d6830165bda (patch)
tree2166337e82a26814e9ff9baffbc83c76f6eea235 /gcc
parent360e3406fb78ed13f168c25851b343ec6411aa12 (diff)
downloadgcc-755fdaab8ed0d1c1f954c21a2a4a8d6830165bda.zip
gcc-755fdaab8ed0d1c1f954c21a2a4a8d6830165bda.tar.gz
gcc-755fdaab8ed0d1c1f954c21a2a4a8d6830165bda.tar.bz2
re PR fortran/47266 (Optimization: Declare PRIVATE module procedures as "TREE_PUBLIC = 0" ("static function"))
2015-11-13 Dominique d'Humieres <dominiq@lps.ens.fr> PR fortran/47266 * gfortran.dg/warn_unused_function_2.f90: New test. From-SVN: r230298
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog16
-rw-r--r--gcc/testsuite/gfortran.dg/module_private_2.f9034
2 files changed, 38 insertions, 12 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 66b3d18..0697b5a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,15 +1,7 @@
-2015-11-13 Alan Hayward <alan.hayward@arm.com>
-
- PR tree-optimization/66558
- * gcc.dg/vect/pr65947-1.c: Add checks.
- * gcc.dg/vect/pr65947-2.c: Add checks.
- * gcc.dg/vect/pr65947-3.c: Add checks.
- * gcc.dg/vect/pr65947-4.c: Add checks.
- * gcc.dg/vect/pr65947-5.c: Add checks.
- * gcc.dg/vect/pr65947-6.c: Add checks.
- * gcc.dg/vect/pr65947-10.c: Add checks.
- * gcc.dg/vect/pr65947-12.c: New test.
- * gcc.dg/vect/pr65947-13.c: New test.
+2015-11-13 Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ PR fortran/47266
+ * gfortran.dg/warn_unused_function_2.f90: New test.
2015-11-13 Christophe Lyon <christophe.lyon@linaro.org>
diff --git a/gcc/testsuite/gfortran.dg/module_private_2.f90 b/gcc/testsuite/gfortran.dg/module_private_2.f90
new file mode 100644
index 0000000..847c58d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/module_private_2.f90
@@ -0,0 +1,34 @@
+! { dg-do compile }
+! { dg-options "-O2 -fdump-tree-optimized" }
+!
+! PR fortran/47266
+!
+! Check whether the private procedure "priv" is optimized away
+!
+module m
+ implicit none
+ private :: priv
+ private :: export1, export2
+ public :: pub
+contains
+ integer function priv()
+ priv = 44
+ end function priv
+ integer function export1()
+ export1 = 45
+ end function export1
+ function export2() bind(C) ! { dg-warning "is marked PRIVATE" }
+ use iso_c_binding, only: c_int
+ integer(c_int) :: export2
+ export2 = 46
+ end function export2
+ subroutine pub(a,b)
+ integer :: a
+ procedure(export1), pointer :: b
+ a = priv()
+ b => export1
+ end subroutine pub
+end module m
+! { dg-final { scan-tree-dump-times "priv" 0 "optimized" } }
+! { dg-final { scan-tree-dump-times "export1 \\(\\)" 1 "optimized" } }
+! { dg-final { scan-tree-dump-times "export2 \\(\\)" 1 "optimized" } }