diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-05-06 17:03:10 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-05-06 17:03:10 +0000 |
commit | 34f4edf8ec4218248d3392351988b79260693f23 (patch) | |
tree | 128be1c28a19f18dd54e51d827c7eef015ccb6f2 /gcc | |
parent | b8c1d4a1bce11dd9fad78ef63ec757aebaad3054 (diff) | |
download | gcc-34f4edf8ec4218248d3392351988b79260693f23.zip gcc-34f4edf8ec4218248d3392351988b79260693f23.tar.gz gcc-34f4edf8ec4218248d3392351988b79260693f23.tar.bz2 |
testsuite_hooks.cc (try_mkfifo): Remove.
* testsuite/testsuite_hooks.cc (try_mkfifo): Remove.
* testsuite/testsuite_hooks.h (try_mkfifo): Likewise.
* testsuite/27_io/basic_filebuf/close/char/4879.cc: Use
dg-require-fork and dg-require-mkfifo. Replace try_mkfifo with
mkfifo.
* testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise.
* testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc: Likewise.
* testsuite/27_io/basic_filebuf/imbue/char/13582-2.cc: Likewise.
* testsuite/27_io/basic_filebuf/imbue/wchar_t/13582-2.cc:
Likewise.
* testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc:
Likewise.
* testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise.
* testsuite/27_io/basic_filebuf/showmanyc/char/9533-1.cc:
Likewise.
* testsuite/27_io/basic_filebuf/underflow/char/10097.cc: Likewise.
* testsuite/27_io/objects/char/7.cc: Likewise.
* testsuite/27_io/objects/char/9661-1.cc: Likewise.
* testsuite/27_io/objects/wchar_t/7.cc: Likewise.
* testsuite/27_io/objects/wchar_t/9661-1.cc: Likewise.
* lib/target-supports-dg.exp (dg-require-fork): New function.
(dg-require-mkfifo): Likewise.
* lib/target-supports.exp (check_function_available): New
function.
(check_fork_available): Likewise.
(check_mkfifo_available): Likewise.
From-SVN: r99325
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/lib/scanasm.exp | 2 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports-dg.exp | 18 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 47 |
4 files changed, 75 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4b3ca39..8ecd101 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2005-05-06 Mark Mitchell <mark@codesourcery.com> + + * lib/target-supports-dg.exp (dg-require-fork): New function. + (dg-require-mkfifo): Likewise. + * lib/target-supports.exp (check_function_available): New + function. + (check_fork_available): Likewise. + (check_mkfifo_available): Likewise. + 2005-05-06 Jeff Law <law@redhat.com> * gcc.c-torture/compile/pr21380.c: New test. diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp index 33c574a..1e11218 100644 --- a/gcc/testsuite/lib/scanasm.exp +++ b/gcc/testsuite/lib/scanasm.exp @@ -118,7 +118,7 @@ proc scan-not-hidden { args } { set output_file "[file rootname [file tail $testcase]].s" set symbol [lindex $args 0] - set hidden_scan [hidden-scan-for symbol] + set hidden_scan [hidden-scan-for $symbol] set args [lreplace $args 0 0 "$hidden_scan"] diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp index 1f2242f..899473f 100644 --- a/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc/testsuite/lib/target-supports-dg.exp @@ -122,6 +122,24 @@ proc dg-require-effective-target { args } { } } +# If this target does not have fork, skip this test. + +proc dg-require-fork { args } { + if { ![check_fork_available] } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } +} + +# If this target does not have mkfifo, skip this test. + +proc dg-require-mkfifo { args } { + if { ![check_mkfifo_available] } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } +} + # Check the flags with which the test will be run against options in # a test directive that will skip or xfail that test. The DejaGnu proc # check_conditional_xfail will look at the options in compiler_flags, so diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 6d47ece..90139ff 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -601,6 +601,53 @@ proc check_alpha_max_hw_available { } { return $alpha_max_hw_available_saved } +# Returns true iff the FUNCTION is available on the target system. +# (This is essentially a Tcl implementation of Autoconf's +# AC_CHECK_FUNC.) + +proc check_function_available { function } { + set var "${function}_available_saved" + global $var + global tool + + if {![info exists $var]} { + # Assume it exists. + set $var 1 + # Check to make sure. + set src "function[pid].c" + set exe "function[pid].exe" + + set f [open $src "w"] + puts $f "int main () { $function (); }" + close $f + + set lines [${tool}_target_compile $src $exe executable ""] + file delete $src + file delete $exe + + if {![string match "" $lines]} then { + set $var 0 + verbose -log "$function is not available" + } else { + verbose -log "$function is available" + } + } + + eval return \$$var +} + +# Returns ture iff "fork" is available on the target system. + +proc check_fork_available {} { + return [check_function_available "fork"] +} + +# Returns ture iff "mkfifo" is available on the target system. + +proc check_mkfifo_available {} { + return [check_function_available "mkfifo"] +} + # Return 1 if we're generating 32-bit code using default options, 0 # otherwise. # |