diff options
author | Daniel Franke <dfranke@gcc.gnu.org> | 2009-04-11 05:33:11 -0400 |
---|---|---|
committer | Daniel Franke <dfranke@gcc.gnu.org> | 2009-04-11 05:33:11 -0400 |
commit | 568eecadba8d1e6f1bce10ce0bd27b739c469048 (patch) | |
tree | 763cd45ceff094a3c6a0c824ec42bf738c78d786 /gcc/testsuite | |
parent | 8810712ed9d1a5c2031c640706af1a87acfd3e06 (diff) | |
download | gcc-568eecadba8d1e6f1bce10ce0bd27b739c469048.zip gcc-568eecadba8d1e6f1bce10ce0bd27b739c469048.tar.gz gcc-568eecadba8d1e6f1bce10ce0bd27b739c469048.tar.bz2 |
resolve.c (resolve_global_procedure): Enable whole-file checking for procedures that are declared later in the file.
gcc/fortran/:
2009-04-11 Daniel Franke <frake.daniel@gmail.com>
* resolve.c (resolve_global_procedure): Enable whole-file checking for
procedures that are declared later in the file.
gcc/testsuite:
2009-04-11 Daniel Franke <franke.daniel@gmail.com>
* gfortran.dg/whole_file_5.f90: New.
* gfortran.dg/whole_file_6.f90: New.
From-SVN: r145953
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/whole_file_5.f90 | 18 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/whole_file_6.f90 | 18 |
3 files changed, 41 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bcd3c2b..108e17d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-04-11 Daniel Franke <franke.daniel@gmail.com> + + * gfortran.dg/whole_file_5.f90: New. + * gfortran.dg/whole_file_6.f90: New. + 2009-04-11 Richard Guenther <rguenther@suse.de> PR tree-optimization/39713 diff --git a/gcc/testsuite/gfortran.dg/whole_file_5.f90 b/gcc/testsuite/gfortran.dg/whole_file_5.f90 new file mode 100644 index 0000000..a035046 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/whole_file_5.f90 @@ -0,0 +1,18 @@ +! { dg-do "compile" } +! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" } +! +! Check that inlining of functions declared BEFORE usage works. +! If yes, then the dump does not contain a call to F(). +! + +INTEGER FUNCTION f() + f = 42 +END FUNCTION + +PROGRAM main + INTEGER :: a + a = f() + print *, a +END PROGRAM + +! { dg-final { scan-tree-dump-times "= f\(\)" 0 "optimized" } } diff --git a/gcc/testsuite/gfortran.dg/whole_file_6.f90 b/gcc/testsuite/gfortran.dg/whole_file_6.f90 new file mode 100644 index 0000000..cb9e737 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/whole_file_6.f90 @@ -0,0 +1,18 @@ +! { dg-do "compile" } +! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" } +! +! Check that inlining of functions declared AFTER usage works. +! If yes, then the dump does not contain a call to F(). +! + +PROGRAM main + INTEGER :: a(3) + a = f() + print *, a +END PROGRAM + +INTEGER FUNCTION f() + f = 42.0 +END FUNCTION + +! { dg-final { scan-tree-dump-times "= f\(\)" 0 "optimized" } } |