This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, PR16464] testsuite: account for fortran loop-constructs
- From: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Cc: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>, gcc-patches at gcc dot gnu dot org, billingd at gcc dot gnu dot org
- Date: Fri, 2 Mar 2012 15:01:31 +0100
- Subject: [PATCH, PR16464] testsuite: account for fortran loop-constructs
- Authentication-results: mr.google.com; spf=pass (google.com: domain of rep.dot.nop@gmail.com designates 10.14.96.6 as permitted sender) smtp.mail=rep.dot.nop@gmail.com; dkim=pass header.i=rep.dot.nop@gmail.com
Hi,
PR testsuite/16464 notes that some g77/*.f that contain loops were not
compiled with loop flags.
Compiling only testcases with loop optimization that contain
"endfor/enddo" will lead to ~25% fewer tests (some 30000 instead of
previously 40000).
Testing in progess, ok if this completes successfully?
gcc/testsuite/ChangeLog:
2012-03-02 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
PR testsuite/16464
* lib/gfortran-dg.exp (gfortran-dg-runtest): Depend options
on weather the testcase is just preprocessed/compiled or
contains loop statements.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
gcc/testsuite/lib/gfortran-dg.exp | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/gcc/testsuite/lib/gfortran-dg.exp b/gcc/testsuite/lib/gfortran-dg.exp
index 50753df..56ecc69 100644
--- a/gcc/testsuite/lib/gfortran-dg.exp
+++ b/gcc/testsuite/lib/gfortran-dg.exp
@@ -90,7 +90,7 @@ proc gfortran-dg-prune { system text } {
# as c-torture does.
proc gfortran-dg-runtest { testcases default-extra-flags } {
global runtests
- global DG_TORTURE_OPTIONS torture_with_loops
+ global DG_TORTURE_OPTIONS torture_with_loops torture_without_loops
torture-init
set-torture-options $DG_TORTURE_OPTIONS
@@ -102,12 +102,26 @@ proc gfortran-dg-runtest { testcases default-extra-flags } {
continue
}
- # look if this is dg-do-run test, in which case
- # we cycle through the option list, otherwise we don't
- if [expr [search_for $test "dg-do run"]] {
- set option_list $torture_with_loops
- } else {
- set option_list [list { -O } ]
+ # look if this is a dg-do-preprocess or dg-to-compile test,
+ # in which case we do not need to cycle through all options.
+ set option_list $torture_without_loops
+ set tmp [grep $test "(dg-do\[ \t\]+(preprocess|compile)|^(?:\[^!\]*\[ \t\]*)\[eE\]\[nN\]\[dD\]\[ \t\]*(\[fF\]\[oO\]\[rR\]|\[dD\]\[oO\]))" line]
+ foreach i $tmp {
+ regexp "(\[0-9\]+)\[ \t\]+(?:dg-do\[ \t\]+)(preprocess|compile)" $i i lineno what
+ if {[info exists what]} {
+ set option_list [list { -O } ]
+ verbose "Line $lineno: dg-do $what, trimming option_list" 3
+ break
+ } else {
+ regexp "(\[0-9\]+)(?:.*)(\[eE\]\[nN\]\[dD\]\[ \t\]*(\[fF\]\[oO\]\[rR\]|\[dD\]\[oO\]))" $i i lineno loop
+ if {[info exists loop]} {
+ set option_list $torture_with_loops
+ verbose "Line $lineno: extending option_list: loop detected: `$loop'" 3
+ break
+ # } else {
+ # set option_list $torture_without_loops
+ }
+ }
}
set nshort [file tail [file dirname $test]]/[file tail $test]
--
1.7.9