This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[PATCH Take 2]: Fix two fortran testcases when using -fpic/-fPIC
This patch is an update to my original fix for two fortran testcases that
were failing with -fpic/-fPIC. As pointed out here:
http://gcc.gnu.org/ml/gcc-patches/2009-08/msg01194.html
there was an error in the regexp pattern in the two tests I touched
(unrelated to my patch). The pattern worked by accident but I decided to
fix it anyway.
Tested on x86_64-unknown-linux-gnu via "make check". I first added the
pattern fixes and ensured that the tests still failed (i.e. the corrected
pattern matched) with -fpic/-fPIC. Then I added the -fpie patch on top
and ensured it fixed the two testcases. The combined patch is below.
Okay for mainline?
Thanks,
--Kaveh
2009-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gfortran.dg/whole_file_5.f90: Add -fpie when pic, fix scan
pattern.
* gfortran.dg/whole_file_6.f90: Likewise.
diff -rup orig/egcc-SVN20090828/gcc/testsuite/gfortran.dg/whole_file_5.f90 egcc-SVN20090828/gcc/testsuite/gfortran.dg/whole_file_5.f90
--- orig/egcc-SVN20090828/gcc/testsuite/gfortran.dg/whole_file_5.f90 2009-04-27 02:00:52.000000000 +0200
+++ egcc-SVN20090828/gcc/testsuite/gfortran.dg/whole_file_5.f90 2009-08-28 15:09:50.000000000 +0200
@@ -1,5 +1,6 @@
! { dg-do "compile" }
! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" }
+! { dg-options "-O3 -fwhole-file -fdump-tree-optimized -fpie" { target { ! nonpic } } }
!
! Check that inlining of functions declared BEFORE usage works.
! If yes, then the dump does not contain a call to F().
@@ -15,5 +16,5 @@ PROGRAM main
print *, a
END PROGRAM
-! { dg-final { scan-tree-dump-times "= f\(\)" 0 "optimized" } }
+! { dg-final { scan-tree-dump-times "= f \\(\\)" 0 "optimized" } }
! { dg-final { cleanup-tree-dump "optimized" } }
diff -rup orig/egcc-SVN20090828/gcc/testsuite/gfortran.dg/whole_file_6.f90 egcc-SVN20090828/gcc/testsuite/gfortran.dg/whole_file_6.f90
--- orig/egcc-SVN20090828/gcc/testsuite/gfortran.dg/whole_file_6.f90 2009-04-27 02:00:52.000000000 +0200
+++ egcc-SVN20090828/gcc/testsuite/gfortran.dg/whole_file_6.f90 2009-08-28 15:09:50.000000000 +0200
@@ -1,5 +1,6 @@
! { dg-do "compile" }
! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" }
+! { dg-options "-O3 -fwhole-file -fdump-tree-optimized -fpie" { target { ! nonpic } } }
!
! Check that inlining of functions declared AFTER usage works.
! If yes, then the dump does not contain a call to F().
@@ -15,5 +16,5 @@ INTEGER FUNCTION f()
f = 42.0
END FUNCTION
-! { dg-final { scan-tree-dump-times "= f\(\)" 0 "optimized" } }
+! { dg-final { scan-tree-dump-times "= f \\(\\)" 0 "optimized" } }
! { dg-final { cleanup-tree-dump "optimized" } }