* 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
+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.
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"]
}
}
+# 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
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.
#
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
signal(SIGPIPE, SIG_IGN);
unlink(name);
- if (0 != try_mkfifo(name, S_IRWXU))
+ if (0 != mkfifo(name, S_IRWXU))
{
std::cerr << "failed to create fifo" << std::endl;
exit(-1);
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
signal(SIGPIPE, SIG_IGN);
unlink(name);
- try_mkfifo(name, S_IRWXU);
+ mkfifo(name, S_IRWXU);
int child = fork();
VERIFY( child != -1 );
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
const char* name = "tmp_fifo_13171-2";
unlink(name);
- try_mkfifo(name, S_IRWXU);
+ mkfifo(name, S_IRWXU);
semaphore s1, s2;
int child = fork();
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
// 2004-01-11 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
const char* name = "tmp_fifo_13582-2";
unlink(name);
- try_mkfifo(name, S_IRWXU);
+ mkfifo(name, S_IRWXU);
int child = fork();
if (child == 0)
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
// 2004-01-11 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2004 Free Software Foundation, Inc.
const char* name = "tmp_fifo_13582-2";
unlink(name);
- try_mkfifo(name, S_IRWXU);
+ mkfifo(name, S_IRWXU);
int child = fork();
if (child == 0)
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
// 2004-04-16 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
signal(SIGPIPE, SIG_IGN);
unlink(name);
- try_mkfifo(name, S_IRWXU);
+ mkfifo(name, S_IRWXU);
semaphore s1;
int child = fork();
+// { dg-require-mkfifo "" }
+
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
signal(SIGPIPE, SIG_IGN);
unlink(name);
- try_mkfifo(name, S_IRWXU);
+ mkfifo(name, S_IRWXU);
std::filebuf fbuf;
// The use of ios_base::ate implies an attempt to seek on the file
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
// Copyright (C) 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
signal(SIGPIPE, SIG_IGN);
unlink(name);
- if (0 != try_mkfifo(name, S_IRWXU))
+ if (0 != mkfifo(name, S_IRWXU))
{
VERIFY( false );
}
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
signal(SIGPIPE, SIG_IGN);
unlink(name);
- if (0 != try_mkfifo(name, S_IRWXU))
+ if (0 != mkfifo(name, S_IRWXU))
{
VERIFY( false );
}
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
// 2003-04-26 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
signal(SIGPIPE, SIG_IGN);
unlink(name);
- try_mkfifo(name, S_IRWXU);
+ mkfifo(name, S_IRWXU);
semaphore s1;
int child = fork();
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
// 2003-04-30 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
signal(SIGPIPE, SIG_IGN);
unlink(name);
- try_mkfifo(name, S_IRWXU);
+ mkfifo(name, S_IRWXU);
semaphore s1, s2;
int child = fork();
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
// 2003-05-01 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
signal(SIGPIPE, SIG_IGN);
unlink(name);
- try_mkfifo(name, S_IRWXU);
+ mkfifo(name, S_IRWXU);
semaphore s1;
int child = fork();
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
// 2003-04-30 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
signal(SIGPIPE, SIG_IGN);
unlink(name);
- try_mkfifo(name, S_IRWXU);
+ mkfifo(name, S_IRWXU);
semaphore s1, s2;
int child = fork();
#endif
}
- int
- try_mkfifo (const char* filename, mode_t mode)
- {
-#if defined (_NEWLIB_VERSION) || defined (__MINGW32_VERSION)
- /* Newlib and MinGW32 do not have mkfifo. */
- exit(0);
-#else
- return mkfifo(filename, mode);
-#endif
- }
-
counter::size_type counter::count = 0;
unsigned int copy_constructor::count_ = 0;
unsigned int copy_constructor::throw_on_ = 0;
std::locale
try_named_locale(const char* name);
- int
- try_mkfifo (const char* filename, mode_t mode);
-
// Counting.
struct counter