[testsuite] use new ADDITIONAL_TORTURE_OPTIONS if defined

Janis Johnson janis187@us.ibm.com
Thu Nov 6 00:13:00 GMT 2008


Sometimes it's useful to run the torture tests with additional options.
This patch causes the testsuite support for torture options to look for a
new variable, ADDITIONAL_TORTURE_OPTIONS, and concatenate it to the list
TORTURE_OPTIONS.  The options used as examples in the documentation don't
cause any new test failures, but there are probably other optimizations
that do.

Applied to mainline after running the entire testsuite, and testing small
runs with ADDITIONAL_TORTURE_OPTIONS defined in either $HOME/.dejagnurc or
objdir/gcc/site.exp.

2008-11-05  Janis Johnson  <janis187@us.ibm.com>

gcc/
	* doc/sourcebuild.texi (Torture Tests): Add ADDITIONAL_TORTURE_OPTIONS.
gcc/testsuite/
	* lib/c-torture.exp: Use ADDITIONAL_TORTURE_OPTIONS if defined.
	* lib/gcc-dg.exp: Ditto.
	* lib/fortran-torture.exp: Ditto.
	* lib/objc-torture.exp: Ditto.

Index: gcc/doc/sourcebuild.texi
===================================================================
--- gcc/doc/sourcebuild.texi	(revision 141554)
+++ gcc/doc/sourcebuild.texi	(working copy)
@@ -1573,4 +1573,12 @@
 @var{DG_TORTURE_OPTIONS} defined in @file{gcc-dg.exp}.
 
 Most uses of torture options can override the default lists by defining
-@var{TORTURE_OPTIONS} in a @file{.dejagnurc} file.
+@var{TORTURE_OPTIONS} or add to the default list by defining
+@var{ADDITIONAL_TORTURE_OPTIONS}.  Define these in a @file{.dejagnurc}
+file or add them to the @file{site.exp} file; for example
+
+@smallexample
+set ADDITIONAL_TORTURE_OPTIONS  [list @\
+  @{ -O2 -ftree-loop-linear @} @\
+  @{ -O2 -fpeel-loops @} ]
+@end smallexample
Index: gcc/testsuite/lib/c-torture.exp
===================================================================
--- gcc/testsuite/lib/c-torture.exp	(revision 141554)
+++ gcc/testsuite/lib/c-torture.exp	(working copy)
@@ -43,6 +43,11 @@
 	{ -Os } ]
 }
 
+if [info exists ADDITIONAL_TORTURE_OPTIONS] {
+    set C_TORTURE_OPTIONS \
+	[concat $C_TORTURE_OPTIONS $ADDITIONAL_TORTURE_OPTIONS]
+}
+
 global GCC_UNDER_TEST
 if ![info exists GCC_UNDER_TEST] {
     set GCC_UNDER_TEST "[find_gcc]"
Index: gcc/testsuite/lib/gcc-dg.exp
===================================================================
--- gcc/testsuite/lib/gcc-dg.exp	(revision 141554)
+++ gcc/testsuite/lib/gcc-dg.exp	(working copy)
@@ -53,6 +53,11 @@
 	{ -Os } ]
 }
 
+if [info exists ADDITIONAL_TORTURE_OPTIONS] {
+    set DG_TORTURE_OPTIONS \
+	[concat $DG_TORTURE_OPTIONS $ADDITIONAL_TORTURE_OPTIONS]
+}
+
 global GCC_UNDER_TEST
 if ![info exists GCC_UNDER_TEST] {
     set GCC_UNDER_TEST "[find_gcc]"
Index: gcc/testsuite/lib/fortran-torture.exp
===================================================================
--- gcc/testsuite/lib/fortran-torture.exp	(revision 141554)
+++ gcc/testsuite/lib/fortran-torture.exp	(working copy)
@@ -82,6 +82,10 @@
 	lappend options $vectorizer_options
     }
 
+    if [info exists ADDITIONAL_TORTURE_OPTIONS] {
+	set options [concat $options $ADDITIONAL_TORTURE_OPTIONS]
+    }
+
     return $options
 }
 
Index: gcc/testsuite/lib/objc-torture.exp
===================================================================
--- gcc/testsuite/lib/objc-torture.exp	(revision 141554)
+++ gcc/testsuite/lib/objc-torture.exp	(working copy)
@@ -60,6 +60,11 @@
 	" -Os " ]
 }
 
+if [info exists ADDITIONAL_TORTURE_OPTIONS] {
+  set OBJC_TORTURE_OPTIONS \
+	[concat $OBJC_TORTURE_OPTIONS $ADDITIONAL_TORTURE_OPTIONS]
+}
+
 #
 # objc-torture-compile -- runs the Tege OBJC-torture test
 #




More information about the Gcc-patches mailing list