[patch, fortran] pr21061 - gfortran ignores -Werror

Bernhard Fischer rep.nop@aon.at
Sun Nov 5 13:44:00 GMT 2006


On Sat, Nov 04, 2006 at 12:36:27PM +0100, Bernhard Fischer wrote:
>On Thu, Nov 02, 2006 at 05:11:06PM -0800, Janis Johnson wrote:
>>On Thu, Nov 02, 2006 at 06:46:11PM +0100, Bernhard Fischer wrote:
>>> >It was not yet fixed nor committed due to problems with dejagnu.
>>> >See http://gcc.gnu.org/ml/gcc/2006-10/msg00408.html
>>> >
>>> >I'm rewriting the testcases (for free- and fixed form) now and want to
>>> >see if i can use dg-final { scan-assembler ".*" }.
>>
>>I figured out how to write procs output-exists and output-exists-not
>>that can be called from dg-final to verify whether or not the compiler
>>output file was not produced.  Will that help?
>
>That would help, yes. I'd need this on trunk, the 4_2 and 4_1 branches
>if possible.
>
>Thanks!

What i did come up with was the attached, fwiw.
I did not (yet) look at how to distinguish dg-do modes, in order to get
the output_file extension right.

This works for me for
$ head -n 4 gcc/testsuite/gfortran.dg/warnings_are_errors_1.f 
! { dg-do compile }
! { dg-options " -Werror" }
! { dg-final { output-exists-not } }
! PR fortran/21061

but i take it there is a more elegant way to do this.
-------------- next part --------------
Index: lib/scanasm.exp
===================================================================
--- lib/scanasm.exp	(revision 118494)
+++ lib/scanasm.exp	(working copy)
@@ -59,6 +59,31 @@
     }
 }
 
+# Check that an output file does exist
+proc output-exists { } {
+    upvar 2 name testcase
+    set output_file "[file rootname [file tail $testcase]].s"
+
+    if { [file exists $output_file] } {
+        pass "$testcase"
+    } else {
+        fail "$testcase"
+    }
+}
+
+# Check that an output file does not exist
+proc output-exists-not { } {
+    upvar 2 name testcase
+    set output_file "[file rootname [file tail $testcase]].s"
+
+    if { [file exists $output_file] } {
+        fail "$testcase"
+    } else {
+        pass "$testcase"
+    }
+}
+
+
 # Look for a pattern in the .s file produced by the compiler.  See
 # dg-scan for details.
 


More information about the Fortran mailing list