]>
Commit | Line | Data |
---|---|---|
aa118a03 | 1 | # Copyright (C) 1997-2014 Free Software Foundation, Inc. |
9e78e45a DB |
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 | |
748086b7 | 5 | # the Free Software Foundation; either version 3 of the License, or |
9e78e45a DB |
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 | |
748086b7 JJ |
14 | # along with this program; see the file COPYING3. If not see |
15 | # <http://www.gnu.org/licenses/>. | |
9e78e45a DB |
16 | |
17 | # Prune messages from g++ that aren't useful. | |
18 | ||
a40cc81f JM |
19 | # Prune any messages matching ARGS[1] (a regexp) from test output. |
20 | proc dg-prune-output { args } { | |
21 | global additional_prunes | |
22 | ||
23 | if { [llength $args] != 2 } { | |
24 | error "[lindex $args 1]: need one argument" | |
25 | return | |
26 | } | |
27 | ||
28 | lappend additional_prunes [lindex $args 1] | |
29 | } | |
30 | ||
31 | proc libstdc++-dg-prune { system text } { | |
32 | global additional_prunes | |
9e78e45a | 33 | |
9fec0042 MLI |
34 | # send_user "Before:$text\n" |
35 | ||
36 | # Ignore caret diagnostics. Unfortunately dejaGNU trims leading | |
37 | # spaces, so one cannot rely on them being present. | |
38 | regsub -all "(^|\n)\[^\n\]+\n *\\^\n" $text "\n" text | |
39 | ||
9e78e45a | 40 | # Cygwin warns about -ffunction-sections |
dd37368c | 41 | regsub -all "(^|\n)\[^\n\]*: -ffunction-sections may affect debugging on some targets\[^\n\]*" $text "" text |
9e78e45a | 42 | |
ab10a269 DB |
43 | # Remove parts of warnings that refer to location of previous |
44 | # definitions, etc as these confuse dejagnu | |
3579964b | 45 | regsub -all "(^|\n)(\[^\n\]*: )?In ((static member |lambda )?function|member|method|(copy )?constructor|destructor|instantiation|substitution|program|subroutine|block-data)\[^\n\]*" $text "" text |
a40cc81f | 46 | regsub -all "(^|\n)\[^\n\]*(: )?At (top level|global scope):\[^\n\]*" $text "" text |
3ff60975 | 47 | regsub -all "(^|\n)\[^\n\]*: (recursively )?required \[^\n\]*" $text "" text |
a40cc81f JM |
48 | regsub -all "(^|\n)\[^\n\]*: . skipping \[0-9\]* instantiation contexts \[^\n\]*" $text "" text |
49 | regsub -all "(^|\n) inlined from \[^\n\]*" $text "" text | |
50 | # Why doesn't GCC need these to strip header context? | |
51 | regsub -all "(^|\n)In file included from \[^\n\]*" $text "" text | |
52 | regsub -all "(^|\n)\[ \t\]*from \[^\n\]*" $text "" text | |
ab10a269 | 53 | |
377a5364 JM |
54 | # Ignore informational notes. |
55 | regsub -all "(^|\n)\[^\n\]*: note: \[^\n\]*" $text "" text | |
56 | ||
d62c1a1f AS |
57 | # Ignore errata warning from IA64 assembler. |
58 | regsub -all "(^|\n)\[^\n\]*: Additional NOP may be necessary to workaround Itanium processor A/B step errata" $text "" text | |
59 | regsub -all "(^|\n)\[^\n*\]*: Assembler messages:\[^\n\]*" $text "" text | |
60 | ||
082b966f JH |
61 | # Ignore harmless warnings from Xcode 3.2.x. |
62 | regsub -all "(^|\n)\[^\n\]*ld: warning: can't add line info to anonymous symbol\[^\n\]*" $text "" text | |
63 | regsub -all "(^|\n)\[^\n\]*warning: DWARFDebugInfoEntry::AppendDependants\[^\n\]*AT_\[^\n\]*_bound\[^\n\]*FORM_ref4\[^\n\]*" $text "" text | |
64 | regsub -all "(^|\n)\[^\n\]*warning:\[^\n\]*TAG_variable: AT_location\[^\n\]*didn't have valid function low pc\[^\n\]*" $text "" text | |
65 | ||
5513ecd5 JH |
66 | # Ignore harmless warnings from Xcode 4.0. |
67 | regsub -all "(^|\n)\[^\n\]*ld: warning: could not create compact unwind for\[^\n\]*" $text "" text | |
68 | ||
a40cc81f JM |
69 | foreach p $additional_prunes { |
70 | if { [string length $p] > 0 } { | |
71 | # Following regexp matches a complete line containing $p. | |
72 | regsub -all "(^|\n)\[^\n\]*$p\[^\n\]*" $text "" text | |
73 | } | |
74 | } | |
75 | ||
9fec0042 | 76 | # send_user "After:$text\n" |
9e78e45a DB |
77 | return $text |
78 | } |