This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

V3 Testsuite PATCH: Disable tests on newlib


This patch has only been applied to the csl-arm-branch because I am
not quite sure it is the right thing to do.  Or, rather, I am sure it
is not the right thing to do, but I'm not sure if it is practical to
do the right thing.

The problem is that these tests all use mkfifo.  Since mkfifo is not
part of newlib (at least on arm-none-elf), these tests fail there.
Adding a:

  // { dg-do run { xfail arm-none-elf } }

line does not fix them, for reasons I do not fully comprehend.

This patch, therefore, simply eliminates the body of the test if
_NEWLIB_VERSION is defined.  That might be overkill -- perhaps some
versions of newlib do provide mkfifo.  I'm not sure.

Benjamin, I think the V3 testsuite needs a better way of dealing with
this situation.  If using mkfifo is essential, then something should
be done on the DejaGNU side of the testsuite to make it possible to
XFAIL these tests on targets that do not have mkfifo.  Or, if I am
simply missing the right incantation, I should discover it. :-)

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2003-12-24  Mark Mitchell  <mark@codesourcery.com>

	* 27_io/basic_filebuf/close/char/4879.cc: Skip on newlib targets.
	* 27_io/basic_filebuf/close/char/9964.cc: Likewise.
	* 27_io/basic_filebuf/imbue/char/13171-2.cc: Likewise.
	* 27_io/basic_filebuf/open/char/9507.cc: Likewise.
	* 27_io/basic_filebuf/showmanyc/char/9533-1.cc: Likewise.
	* 27_io/basic_filebuf/underflow/char/10097.cc: Likewise.
	* 27_io/objects/char/7.cc: Likewise.
	* 27_io/objects/char/9661-1.cc: Likewise.

Index: 27_io/basic_filebuf/close/char/4879.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc,v
retrieving revision 1.3
diff -c -5 -p -r1.3 4879.cc
*** 27_io/basic_filebuf/close/char/4879.cc	23 Sep 2003 20:02:53 -0000	1.3
--- 27_io/basic_filebuf/close/char/4879.cc	24 Dec 2003 15:44:12 -0000
***************
*** 33,42 ****
--- 33,47 ----
  #include <fcntl.h>
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <testsuite_hooks.h>
  
+ #ifdef _NEWLIB_VERSION
+ // Newlib does not have mkfifo.
+ int main () {}
+ #else // _NEWLIB_VERSION
+ 
  // libstdc++/2913, libstdc++/4879
  // John Fardo  <jfardo@laurelnetworks.com>, Brad Garcia <garsh@attbi.com>
  void
  test_04()
  {
*************** main()
*** 95,100 ****
  {
    test_04();
    return 0;
  }
  
! 
--- 100,105 ----
  {
    test_04();
    return 0;
  }
  
! #endif // _NEWLIB_VERSION
Index: 27_io/basic_filebuf/close/char/9964.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc,v
retrieving revision 1.4
diff -c -5 -p -r1.4 9964.cc
*** 27_io/basic_filebuf/close/char/9964.cc	23 Sep 2003 20:02:53 -0000	1.4
--- 27_io/basic_filebuf/close/char/9964.cc	24 Dec 2003 15:44:12 -0000
***************
*** 32,41 ****
--- 32,46 ----
  #include <fcntl.h>
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <testsuite_hooks.h>
  
+ #ifdef _NEWLIB_VERSION
+ // Newlib does not have mkfifo.
+ int main () {}
+ #else // _NEWLIB_VERSION
+ 
  // libstdc++/9964
  void test_07()
  {
    using namespace std;
    bool test __attribute__((unused)) = true;
*************** int
*** 77,81 ****
--- 82,88 ----
  main()
  {
    test_07();
    return 0;
  }
+ 
+ #endif // _NEWLIB_VERSION
Index: 27_io/basic_filebuf/imbue/char/13171-2.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc,v
retrieving revision 1.2.6.1
diff -c -5 -p -r1.2.6.1 13171-2.cc
*** 27_io/basic_filebuf/imbue/char/13171-2.cc	23 Dec 2003 22:11:59 -0000	1.2.6.1
--- 27_io/basic_filebuf/imbue/char/13171-2.cc	24 Dec 2003 15:44:12 -0000
***************
*** 24,33 ****
--- 24,40 ----
  #include <sys/types.h>
  #include <sys/stat.h>
  
  #include <testsuite_hooks.h>
  
+ // { dg-do run }
+ 
+ #ifdef _NEWLIB_VERSION
+ // Newlib does not have mkfifo.
+ int main () {}
+ #else // _NEWLIB_VERSION
+ 
  // libstdc++/13171
  void test01()
  {
    bool test __attribute__((unused)) = true;
    using namespace std;
*************** void test01()
*** 65,69 ****
--- 72,78 ----
  int main()
  {
    test01();
    return 0;
  }
+ 
+ #endif // _NEWLIB_VERSION
Index: 27_io/basic_filebuf/open/char/9507.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc,v
retrieving revision 1.3
diff -c -5 -p -r1.3 9507.cc
*** 27_io/basic_filebuf/open/char/9507.cc	23 Sep 2003 20:02:55 -0000	1.3
--- 27_io/basic_filebuf/open/char/9507.cc	24 Dec 2003 15:44:12 -0000
***************
*** 32,41 ****
--- 32,46 ----
  #include <fcntl.h>
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <testsuite_hooks.h>
  
+ #ifdef _NEWLIB_VERSION
+ // Newlib does not have mkfifo.
+ int main () {}
+ #else // _NEWLIB_VERSION
+ 
  // libstdc++/9507
  void test_06()
  {
    bool test __attribute__((unused)) = true;
    const char* name = "tmp_fifo2";
*************** main()
*** 65,70 ****
  {
    test_06();
    return 0;
  }
  
! 
--- 70,75 ----
  {
    test_06();
    return 0;
  }
  
! #endif // _NEWLIB_VERSION
Index: 27_io/basic_filebuf/showmanyc/char/9533-1.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/showmanyc/char/9533-1.cc,v
retrieving revision 1.3
diff -c -5 -p -r1.3 9533-1.cc
*** 27_io/basic_filebuf/showmanyc/char/9533-1.cc	23 Sep 2003 20:03:00 -0000	1.3
--- 27_io/basic_filebuf/showmanyc/char/9533-1.cc	24 Dec 2003 15:44:12 -0000
***************
*** 27,36 ****
--- 27,41 ----
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <fstream>
  #include <testsuite_hooks.h>
  
+ #ifdef _NEWLIB_VERSION
+ // Newlib does not have mkfifo.
+ int main () {}
+ #else // _NEWLIB_VERSION
+ 
  // libstdc++/9533
  void test_01()
  {
    using namespace std;
    bool test __attribute__((unused)) = true;
*************** main() 
*** 92,96 ****
--- 97,102 ----
  {
    test_01();
    return 0;
  }
  
+ #endif // _NEWLIB_VERSION
Index: 27_io/basic_filebuf/underflow/char/10097.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc,v
retrieving revision 1.3
diff -c -5 -p -r1.3 10097.cc
*** 27_io/basic_filebuf/underflow/char/10097.cc	23 Sep 2003 20:03:02 -0000	1.3
--- 27_io/basic_filebuf/underflow/char/10097.cc	24 Dec 2003 15:44:12 -0000
***************
*** 29,38 ****
--- 29,43 ----
  #include <fcntl.h>
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <testsuite_hooks.h>
  
+ #ifdef _NEWLIB_VERSION
+ // Newlib does not have mkfifo.
+ int main () {}
+ #else // _NEWLIB_VERSION
+ 
  class UnderBuf : public std::filebuf
  {
  public:
    int_type
    pub_underflow()
*************** void test16()
*** 100,104 ****
--- 105,111 ----
  int main() 
  {
    test16();
    return 0;
  }
+ 
+ #endif // _NEWLIB_VERSION
Index: 27_io/objects/char/7.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/objects/char/7.cc,v
retrieving revision 1.3
diff -c -5 -p -r1.3 7.cc
*** 27_io/objects/char/7.cc	23 Sep 2003 20:03:28 -0000	1.3
--- 27_io/objects/char/7.cc	24 Dec 2003 15:44:12 -0000
***************
*** 30,39 ****
--- 30,44 ----
  #include <fcntl.h>
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <testsuite_hooks.h>
  
+ #ifdef _NEWLIB_VERSION
+ // Newlib does not have mkfifo.
+ int main () {}
+ #else // _NEWLIB_VERSION
+ 
  // Check that cout.flush() is called when last ios_base::Init is destroyed.
  void test07()
  {
    using namespace std;
    bool test __attribute__((unused)) = true;
*************** int
*** 74,78 ****
--- 79,85 ----
  main()
  {
    test07();
    return 0;
  }
+ 
+ #endif // _NEWLIB_VERSION
Index: 27_io/objects/char/9661-1.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/objects/char/9661-1.cc,v
retrieving revision 1.3
diff -c -5 -p -r1.3 9661-1.cc
*** 27_io/objects/char/9661-1.cc	23 Sep 2003 20:03:28 -0000	1.3
--- 27_io/objects/char/9661-1.cc	24 Dec 2003 15:44:12 -0000
***************
*** 28,37 ****
--- 28,42 ----
  #include <signal.h>
  #include <fcntl.h>
  #include <sys/types.h>
  #include <sys/stat.h>
  
+ #ifdef _NEWLIB_VERSION
+ // Newlib does not have mkfifo.
+ int main () {}
+ #else // _NEWLIB_VERSION
+ 
  // Check that cin.rdbuf()->sputbackc() puts characters back to stdin.
  // If cin.rdbuf() is a filebuf, this succeeds when stdin is a regular
  // file, but fails otherwise, hence the named fifo.
  void test01()
  {
*************** void test01()
*** 84,88 ****
--- 89,95 ----
  int main()
  {
    test01();
    return 0;
  }
+ 
+ #endif // _NEWLIB_VERSION


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]