OSDN Git Service

gcc/testsuite/:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / lib / prune.exp
1 #   Copyright (C) 1997, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
7
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
16
17 # Prune messages from gcc that aren't useful.
18
19 proc prune_gcc_output { text } {
20     #send_user "Before:$text\n"
21
22     regsub -all "(^|\n)\[^\n\]*: In ((static member )?function|member|method|(copy )?constructor|instantiation|program|subroutine|block-data) \[^\n\]*" $text "" text
23     regsub -all "(^|\n)\[^\n\]*: At (top level|global scope):\[^\n\]*" $text "" text
24     regsub -all "(^|\n)collect2: ld returned \[^\n\]*" $text "" text
25     regsub -all "(^|\n)Please submit.*instructions\[^\n\]*" $text "" text
26
27     # Ignore harmless -fpic warnings.
28     regsub -all "(^|\n)\[^\n\]*: warning: -f(pic|PIC) ignored for target\[^\n\]*" $text "" text
29     regsub -all "(^|\n)\[^\n\]*: warning: -f(pic|PIC)( and -fpic are| is)? not supported\[^\n\]*" $text "" text
30
31     # Ignore errata warning from IA64 assembler.
32     regsub -all "(^|\n)\[^\n\]*: Additional NOP may be necessary to workaround Itanium processor A/B step errata" $text "" text
33     regsub -all "(^|\n)\[^\n*\]*: Assembler messages:\[^\n\]*" $text "" text
34
35     # It would be nice to avoid passing anything to gcc that would cause it to
36     # issue these messages (since ignoring them seems like a hack on our part),
37     # but that's too difficult in the general case.  For example, sometimes
38     # you need to use -B to point gcc at crt0.o, but there are some targets
39     # that don't have crt0.o.
40     regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $text "" text
41     regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $text "" text
42
43     #send_user "After:$text\n"
44
45     return $text
46 }
47
48 # Provide a definition of this if missing (delete after next dejagnu release).
49
50 if { [info procs prune_warnings] == "" } then {
51     proc prune_warnings { text } {
52         return $text
53     }
54 }