gcc-dg.exp (skip_test_and_clear_xfail): New procedure.

* lib/gcc-dg.exp (skip_test_and_clear_xfail): New procedure.
	(dg-require-weak, dg-require-visibility, dg-require-alias,
	dg-require-gc-sections, dg-require-profiling, dg-require-dll,
	dg-require-iconv, dg-require-named-sections): Use it.

From-SVN: r90486
This commit is contained in:
Janis Johnson 2004-11-11 17:59:05 +00:00 committed by Janis Johnson
parent 524136ea7b
commit 5278e47600
2 changed files with 36 additions and 29 deletions

View File

@ -1,5 +1,10 @@
2004-11-11 Janis Johnson <janis187@us.ibm.com>
* lib/gcc-dg.exp (skip_test_and_clear_xfail): New procedure.
(dg-require-weak, dg-require-visibility, dg-require-alias,
dg-require-gc-sections, dg-require-profiling, dg-require-dll,
dg-require-iconv, dg-require-named-sections): Use it.
* lib/gcc-dg.exp (dg-xfail-if): Ignore if skipping the test.
2004-11-11 Nathan Sidwell <nathan@codesourcery.com>

View File

@ -320,19 +320,31 @@ proc gcc-dg-debug-runtest { target_compile trivial opt_opts testcases } {
}
}
# Skip a test and clear all xfail flags that might have been set for it
# by dg-xfail-if or for the xfail list in dg-do. A procedure that calls
# this must specify "upvar dg-do-what dg-do-what".
proc skip_test_and_clear_xfail { } {
global compiler_conditional_xfail_data
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
if [info exists compiler_conditional_xfail_data] {
unset compiler_conditional_xfail_data
}
}
# If this target does not support weak symbols, skip this test.
proc dg-require-weak { args } {
upvar dg-do-what dg-do-what
upvar name name
set weak_available [ check_weak_available ]
if { $weak_available == -1 } {
upvar name name
unresolved "$name"
}
if { $weak_available != 1 } {
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
return
upvar dg-do-what dg-do-what
skip_test_and_clear_xfail
}
}
@ -340,16 +352,14 @@ proc dg-require-weak { args } {
# test.
proc dg-require-visibility { args } {
upvar dg-do-what dg-do-what
upvar name name
set visibility_available [ check_visibility_available ]
if { $visibility_available == -1 } {
upvar name name
unresolved "$name"
}
if { $visibility_available != 1 } {
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
return
upvar dg-do-what dg-do-what
skip_test_and_clear_xfail
}
}
@ -357,16 +367,14 @@ proc dg-require-visibility { args } {
# test.
proc dg-require-alias { args } {
upvar dg-do-what dg-do-what
upvar name name
set alias_available [ check_alias_available ]
if { $alias_available == -1 } {
upvar name name
unresolved "$name"
}
if { $alias_available < 2 } {
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
return
upvar dg-do-what dg-do-what
skip_test_and_clear_xfail
}
}
@ -376,8 +384,7 @@ proc dg-require-alias { args } {
proc dg-require-gc-sections { args } {
if { ![ check_gc_sections_available ] } {
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
return
skip_test_and_clear_xfail
}
}
@ -386,8 +393,7 @@ proc dg-require-gc-sections { args } {
proc dg-require-profiling { args } {
if { ![ check_profiling_available ${args} ] } {
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
return
skip_test_and_clear_xfail
}
}
@ -407,27 +413,23 @@ proc dg-require-dll { args } {
}
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
skip_test_and_clear_xfail
}
proc dg-require-iconv { args } {
if { ![ check_iconv_available ${args} ] } {
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
return
skip_test_and_clear_xfail
}
return
}
# If this target does not support named sections skip this test.
proc dg-require-named-sections { args } {
upvar name name
if { ![ check_named_sections_available ] } {
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
}
if { ![ check_named_sections_available ] } {
upvar dg-do-what dg-do-what
skip_test_and_clear_xfail
}
}
# Prune any messages matching ARGS[1] (a regexp) from test output.