]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite_hooks.cc (try_mkfifo): Remove.
authorMark Mitchell <mark@codesourcery.com>
Fri, 6 May 2005 17:03:10 +0000 (17:03 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 6 May 2005 17:03:10 +0000 (17:03 +0000)
* 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

19 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/lib/scanasm.exp
gcc/testsuite/lib/target-supports-dg.exp
gcc/testsuite/lib/target-supports.exp
libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13582-2.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13582-2.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/showmanyc/char/9533-1.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc
libstdc++-v3/testsuite/27_io/objects/char/7.cc
libstdc++-v3/testsuite/27_io/objects/char/9661-1.cc
libstdc++-v3/testsuite/27_io/objects/wchar_t/7.cc
libstdc++-v3/testsuite/27_io/objects/wchar_t/9661-1.cc
libstdc++-v3/testsuite/testsuite_hooks.cc
libstdc++-v3/testsuite/testsuite_hooks.h

index 4b3ca396ea58c458d8ca6cd8a59fd792263cfa01..8ecd101dca3e825c7ee48127156d2ccdfa55e053 100644 (file)
@@ -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.
index 33c574ac34c94156f23e0abaffc144696280604f..1e112185041ccf842154b4e27b46cdabe76cce26 100644 (file)
@@ -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"]
 
index 1f2242fdc5da07c47d8407541dbda20cd8ee85fd..899473f87360774cf499fe156bde525f595034de 100644 (file)
@@ -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
index 6d47ece07f082397c4f497509437b86e8c18350d..90139ff8395ec736b427c1d57e99b7649945efd1 100644 (file)
@@ -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.
 #
index 96033e5a658399dbeb1ccfb7fb999f524ea3d83a..a7d0c5ced066236548acad4fad4fe83397b87bb2 100644 (file)
@@ -1,3 +1,6 @@
+// { 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
@@ -46,7 +49,7 @@ test_04()
   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);
index d46184a705cf843141571f2d7a66bbe69f3a80b8..6be75113327b21feb33f4ebf16314860c5ddea8c 100644 (file)
@@ -1,3 +1,6 @@
+// { 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
@@ -44,7 +47,7 @@ void test_07()
   signal(SIGPIPE, SIG_IGN);
 
   unlink(name);  
-  try_mkfifo(name, S_IRWXU);
+  mkfifo(name, S_IRWXU);
   
   int child = fork();
   VERIFY( child != -1 );
index e62ed05b5e0743ec959d1cf5f0498aabb087b739..ec7be4982740fb4ff5d41c6e771fede0e5ab9223 100644 (file)
@@ -1,3 +1,6 @@
+// { 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
@@ -38,7 +41,7 @@ void test01()
 
   const char* name = "tmp_fifo_13171-2";
   unlink(name);
-  try_mkfifo(name, S_IRWXU);
+  mkfifo(name, S_IRWXU);
   semaphore s1, s2;
   
   int child = fork();
index 79cd00a15b2de22f68397915dfc9b5a75428fb1e..6a7376df18f4913b063b1fc4192a8fc4fcb0e218 100644 (file)
@@ -1,3 +1,6 @@
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
 // 2004-01-11  Petur Runolfsson  <peturr02@ru.is>
 
 // Copyright (C) 2004, 2005 Free Software Foundation, Inc.
@@ -41,7 +44,7 @@ void test01()
 
   const char* name = "tmp_fifo_13582-2";
   unlink(name);
-  try_mkfifo(name, S_IRWXU);
+  mkfifo(name, S_IRWXU);
 
   int child = fork();
   if (child == 0)
index 7491f8c3a31abe9e83ab63b3f80ebfca12b40469..80fd8e92f916d6701f486b97e0093ee4f13222cc 100644 (file)
@@ -1,3 +1,6 @@
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
 // 2004-01-11  Petur Runolfsson  <peturr02@ru.is>
 
 // Copyright (C) 2004 Free Software Foundation, Inc.
@@ -41,7 +44,7 @@ void test01()
 
   const char* name = "tmp_fifo_13582-2";
   unlink(name);
-  try_mkfifo(name, S_IRWXU);
+  mkfifo(name, S_IRWXU);
   
   int child = fork();
   if (child == 0)
index 2e6f9ec414944c3adc19eb754dc46ac46dd8a3ab..d65b8d09f7023fd6eb181c2a2ecb82da7caf934f 100644 (file)
@@ -1,3 +1,6 @@
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
 // 2004-04-16  Petur Runolfsson  <peturr02@ru.is>
 
 // Copyright (C) 2004, 2005 Free Software Foundation, Inc.
@@ -41,7 +44,7 @@ void test01()
   signal(SIGPIPE, SIG_IGN);
 
   unlink(name);  
-  try_mkfifo(name, S_IRWXU);
+  mkfifo(name, S_IRWXU);
   semaphore s1;
 
   int child = fork();
index 792aeb5a310ae4b4b8a26b23290b7dc008762f80..8035a7b3009592c5552a842470d23e7457c4309c 100644 (file)
@@ -1,3 +1,5 @@
+// { 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
@@ -41,7 +43,7 @@ void test_06()
   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
index 19f0fcee20cc9b1516a05df0bbccfa7c95c411ca..f5126e41df2b22bb9f6fcafaffc5ba28b2581b6a 100644 (file)
@@ -1,3 +1,6 @@
+// { 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
@@ -39,7 +42,7 @@ void test_01()
   signal(SIGPIPE, SIG_IGN);
   unlink(name);
   
-  if (0 != try_mkfifo(name, S_IRWXU))
+  if (0 != mkfifo(name, S_IRWXU))
     {
       VERIFY( false );
     }
index 88ba371d1d9386259b4b150bf8cb8fb9c4f44c6c..1113f84435f9b56b41a028309ac57bfcb7d78b7b 100644 (file)
@@ -1,3 +1,6 @@
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
 // 2001-05-21 Benjamin Kosnik  <bkoz@redhat.com>
 
 // Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
@@ -53,7 +56,7 @@ void test16()
   signal(SIGPIPE, SIG_IGN);
   unlink(name);
   
-  if (0 != try_mkfifo(name, S_IRWXU))
+  if (0 != mkfifo(name, S_IRWXU))
     {
       VERIFY( false );
     }
index 9650f7b26dfe5d0e1deec1f315639da02abd737e..b1b078120c17693a2780df99577326e6f13d8ead 100644 (file)
@@ -1,3 +1,6 @@
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
 // 2003-04-26 Petur Runolfsson  <peturr02@ru.is>
 
 // Copyright (C) 2003, 2005 Free Software Foundation, Inc.
@@ -41,7 +44,7 @@ void test07()
   signal(SIGPIPE, SIG_IGN);
 
   unlink(name);  
-  try_mkfifo(name, S_IRWXU);
+  mkfifo(name, S_IRWXU);
   semaphore s1;
 
   int child = fork();
index 51f2de1402d86917fdd0f9dcf79822892e9f988b..778490896f9faa599be307ba82c0e0f09f336333 100644 (file)
@@ -1,3 +1,6 @@
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
 // 2003-04-30  Petur Runolfsson <peturr02@ru.is>
 
 // Copyright (C) 2003, 2005 Free Software Foundation, Inc.
@@ -42,7 +45,7 @@ void test01()
   signal(SIGPIPE, SIG_IGN);
 
   unlink(name);  
-  try_mkfifo(name, S_IRWXU);
+  mkfifo(name, S_IRWXU);
   semaphore s1, s2;
   
   int child = fork();
index f51b3de8d574c1529d0a69b1010874f5788d9fbc..9351ca48324b8a04e630b47703bc3eed12bc38eb 100644 (file)
@@ -1,3 +1,6 @@
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
 // 2003-05-01 Petur Runolfsson  <peturr02@ru.is>
 
 // Copyright (C) 2003, 2005 Free Software Foundation, Inc.
@@ -41,7 +44,7 @@ void test07()
   signal(SIGPIPE, SIG_IGN);
 
   unlink(name);  
-  try_mkfifo(name, S_IRWXU);
+  mkfifo(name, S_IRWXU);
   semaphore s1;
   
   int child = fork();
index c9e848aaf61fba3d90ad4428ed98cf414465ddce..42b167b052abe1887ef1e9f47183a3a9ff57e1e2 100644 (file)
@@ -1,3 +1,6 @@
+// { dg-require-fork "" }
+// { dg-require-mkfifo "" }
+
 // 2003-04-30  Petur Runolfsson <peturr02@ru.is>
 
 // Copyright (C) 2003, 2005 Free Software Foundation, Inc.
@@ -42,7 +45,7 @@ void test01()
   signal(SIGPIPE, SIG_IGN);
 
   unlink(name);  
-  try_mkfifo(name, S_IRWXU);
+  mkfifo(name, S_IRWXU);
   semaphore s1, s2;
 
   int child = fork();
index e8618fb71df01ea43749076cb7c2a9a931bf843e..a5f1b26e8ccb1a4f6a8fff9a3a899b933f238c96 100644 (file)
@@ -233,17 +233,6 @@ namespace __gnu_test
 #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;
index 635ee1cce4a60a42342523313b7a9094610fdb96..8b8222316e631fb698862720f053c06920418ccd 100644 (file)
@@ -164,9 +164,6 @@ namespace __gnu_test
   std::locale
   try_named_locale(const char* name);
 
-  int
-  try_mkfifo (const char* filename, mode_t mode);
-
 
   // Counting.
   struct counter