This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Testsuite infrastucture patches
- From: "Billinghurst, David (CRTS)" <David dot Billinghurst at riotinto dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 7 Feb 2002 22:01:16 +1100
- Subject: Testsuite infrastucture patches
These patches are required to enable dg-error tests in g77.dg
A g77 error message looks like
/usr/local/src/gcc/gcc/testsuite/g77.dg/pr5473.f: In program `pr5473': /usr/local/src/gcc/gcc/testsuite/g77.dg/pr5473.f:11:
a = BESJN(m,x) ! { dg-error "incorrect type" "incorrect type" }
^
Reference to intrinsic `BESJN' at (^) invalid -- one or more arguments have incorrect type
This patch updates prune.exp to allow fortran program units:
- program
- subroutine
- block-data
The patch to g77-dg.exp puts the error message on the same line as the line number,
deleting the line of source code and the "^" from the message.
Tested on i686-pc-cygwin
2002-02-07 David Billinghurst <David.Billinghurst@riotinto.com>
* lib/prune.exp: Remove "In (program|subroutine"block-data)"
message from g77
* lib/g77-dg.exp: Trim g77 error messages so that they are
recognised by dg.exp.
Index: prune.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/prune.exp,v
retrieving revision 1.5
diff -u -r1.5 prune.exp
--- prune.exp 2002/01/21 12:48:36 1.5
+++ prune.exp 2002/02/07 10:56:37
@@ -19,7 +19,7 @@
proc prune_gcc_output { text } {
#send_user "Before:$text\n"
- regsub -all "(^|\n)\[^\n\]*: In (function|member|method|constructor|instaniation) \[^\n\]*" $text "" text
+ regsub -all "(^|\n)\[^\n\]*: In (function|member|method|constructor|instaniation|program|subroutine|block-data) \[^\n\]*" $text "" text
regsub -all "(^|\n)\[^\n\]*: At (top level|global scope):\[^\n\]*" $text " text
regsub -all "(^|\n)collect2: ld returned \[^\n\]*" $text "" text
regsub -all "(^|\n)Please submit.*instructions\[^\n\]*" $text "" text
Index: g77-dg.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/g77-dg.exp,v
retrieving revision 1.4
diff -u -r1.4 g77-dg.exp
--- g77-dg.exp 2002/01/22 22:08:49 1.4
+++ g77-dg.exp 2002/02/07 10:56:37
@@ -97,6 +97,11 @@
set comp_output [g77_target_compile "$prog" "$output_file" "$compile_type" $options];
+ # Put the error message on the same line as the line number
+ # Remove the line of source code with the error and
+ # the " ^" that points to error
+ regsub -all "\n\[^\n\]*\n *\\^\n" $comp_output "" comp_output
+
return [list $comp_output $output_file]
}