backport: gcc-dg.exp (dg_runtest_extra_prunes): New variable to define extra prune rules that will be applied to all tests in a...

2012-10-08  Terry Guo  <terry.guo@arm.com>

        Backported from mainline
        2012-09-19  Terry Guo  <terry.guo@arm.com>

        * lib/gcc-dg.exp (dg_runtest_extra_prunes): New variable to define
        extra prune rules that will be applied to all tests in a .exp file.
        (gcc-dg-prune): Use rules defined by the above variable.
        * gcc.target/arm/arm.exp (dg_runtest_extra_prunes): Skip all the
        harmless warnings on architecture switch conflict.

From-SVN: r192196
This commit is contained in:
Terry Guo 2012-10-08 06:59:40 +00:00 committed by Xuepeng Guo
parent 9c5476c553
commit 3792233966
3 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,14 @@
2012-10-08 Terry Guo <terry.guo@arm.com>
Backported from mainline
2012-09-19 Terry Guo <terry.guo@arm.com>
* lib/gcc-dg.exp (dg_runtest_extra_prunes): New variable to define
extra prune rules that will be applied to all tests in a .exp file.
(gcc-dg-prune): Use rules defined by the above variable.
* gcc.target/arm/arm.exp (dg_runtest_extra_prunes): Skip all the
harmless warnings on architecture switch conflict.
2012-10-05 Mark Kettenis <kettenis@openbsd.org>
* config.gcc (*-*-openbsd4.[3-9]|*-*-openbsd[5-9]*): Set

View File

@ -30,6 +30,11 @@ if ![info exists DEFAULT_CFLAGS] then {
set DEFAULT_CFLAGS " -ansi -pedantic-errors"
}
# This variable should only apply to tests called in this exp file.
global dg_runtest_extra_prunes
set dg_runtest_extra_prunes ""
lappend dg_runtest_extra_prunes "warning: switch -m(cpu|arch)=.* conflicts with -m(cpu|arch)=.* switch"
# Initialize `dg'.
dg-init
@ -39,3 +44,5 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
# All done.
dg-finish
set dg_runtest_extra_prunes ""

View File

@ -211,9 +211,13 @@ proc gcc-dg-test { prog do_what extra_tool_flags } {
proc gcc-dg-prune { system text } {
global additional_prunes
# Extra prune rules that will apply to tests defined in a .exp file.
# Always remember to clear it in .exp file after executed all tests.
global dg_runtest_extra_prunes
set text [prune_gcc_output $text]
foreach p $additional_prunes {
foreach p "$additional_prunes $dg_runtest_extra_prunes" {
if { [string length $p] > 0 } {
# Following regexp matches a complete line containing $p.
regsub -all "(^|\n)\[^\n\]*$p\[^\n\]*" $text "" text
@ -672,6 +676,7 @@ if { [info procs saved-dg-test] == [list] } {
set additional_files ""
set additional_sources ""
set additional_prunes ""
set dg_runtest_extra_prunes ""
set shouldfail 0
if [info exists compiler_conditional_xfail_data] {
unset compiler_conditional_xfail_data
@ -809,3 +814,4 @@ proc gdb-exists { args } {
}
set additional_prunes ""
set dg_runtest_extra_prunes ""