This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gfortran-dg-runtest, torture options


On Tue, 13 Aug 2013 13:06:30 +0200, I wrote:
> I noticed something strange in the libgomp testresults (but not
> necessarily specific to libgomp): an "arbitrary" set of the Fortran
> execution tests are run just for -O, and others for each of the full set
> of torture options: -O0, -O1, -O2, and so on.  After some time I realized
> it's the set of tests that contain an explicit Âdg-do run directive that
> are run for all torture levels, and the tests that inherit the default
> Âset dg-do-what-default run from libgomp/testsuite/lib/libgomp.exp are
> only run for -O.  This is coming from the special handling in
> gcc/testsuite/lib/gfortran-dg.exp:gfortran-dg-test (which seems to be
> present approximately "forever").  Should this consider the
> dg-do-what-default case, too?  Why is torture testing done only for
> execution tests?  And, why only for Fortran?  Is this behavior generally
> intentional -- of course, bigger testing coverage is nice, but this seems
> a bit arbitrary to me?

Thanks Janis and Mikael for your replies (nearly a year ago...), but
still my questions remain to be answered: in my understanding, the
libgomp testsuite is not the place for compiler torture testing
(different optimization flags and all that -- and, that is done for
Fortran only; gfortran-dg-runtest), but rather, I understand the libgomp
testsuite to be the place for libgomp library testing ;-), and hence I
propose to remove that special casing of Fortran test cases:

--- libgomp/testsuite/lib/libgomp-dg.exp
+++ libgomp/testsuite/lib/libgomp-dg.exp
@@ -5,3 +5,19 @@ proc libgomp-dg-test { prog do_what extra_tool_flags } {
 proc libgomp-dg-prune { system text } {
     return [gcc-dg-prune $system $text]
+# Modified dg-runtest that deal with Fortran modules cleanup.
+proc dg-runtest-fortran { testcases flags default-extra-flags } {
+    global runtests
+    foreach testcase $testcases {
+	# If we're only testing specific files and this isn't one of them, skip it.
+	if {![runtest_file_p $runtests $testcase]} {
+	    continue
+	}
+	verbose "Testing [file tail [file dirname $testcase]]/[file tail $testcase]"
+	list-module-names $testcase
+	dg-test $testcase $flags ${default-extra-flags}
+	cleanup-modules ""
+    }
--- libgomp/testsuite/libgomp.fortran/fortran.exp
+++ libgomp/testsuite/libgomp.fortran/fortran.exp
@@ -11,6 +11,10 @@ set lang_link_flags	"-lgfortran"
 set lang_test_file_found 0
 set quadmath_library_path "../libquadmath/.libs"
+# If a testcase doesn't have special options, use these.
+if ![info exists DEFAULT_CFLAGS] then {
+    set DEFAULT_CFLAGS "-O2"
 # Initialize dg.
@@ -60,7 +64,7 @@ if { $lang_test_file_found } {
     # Main loop.
-    gfortran-dg-runtest $tests ""
+    dg-runtest-fortran $tests "" $DEFAULT_CFLAGS
 # All done.

A follow-up patch could then be to remove all the redundant Âdg-do runÂ
directives from the individual test cases, as that's the default set in
libgomp/testsuite/lib/libgomp.exp: Âset dg-do-what-default runÂ.


Attachment: pgpknlzlS64mh.pgp
Description: PGP signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]