headers.cc: Add includes, compile only.
authorBenjamin Kosnik <bkoz@redhat.com>
Thu, 14 Oct 2004 21:34:52 +0000 (21:34 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Thu, 14 Oct 2004 21:34:52 +0000 (21:34 +0000)
2004-10-14  Benjamin Kosnik  <bkoz@redhat.com>

* testsuite/ext/headers.cc: Add includes, compile only.
* testsuite/ext/hash_map.cc: Move to...
* testsuite/ext/hash_map/1.cc: ...here.
* testsuite/ext/14648.cc: Move to...
* testsuite/ext/hash_map/14648.cc: ...here.
* testsuite/ext/hash_map/instantiate.cc: Add.
* testsuite/ext/hash_set.cc: Move to...
* testsuite/ext/hash_set/1.cc: ...here.
* testsuite/ext/hash_set_explicit_instantiation.cc: Move to...
* testsuite/ext/hash_set/instantiate.cc: ...here.
* testsuite/ext/hash_check_construct_destroy.cc: Move to...
* testsuite/ext/hash_set/check_construct_destroy.cc: ...here.
* testsuite/ext/slist_check_construct_destroy.cc: Move to...
* testsuite/ext/slist/check_construct_destroy.cc: ...here.
* testsuite/ext/slist_explicit_instantiation.cc: Move to...
* testsuite/ext/slist/instantiate.cc: ...here.

From-SVN: r89054

17 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/ext/14648.cc [deleted file]
libstdc++-v3/testsuite/ext/hash_check_construct_destroy.cc [deleted file]
libstdc++-v3/testsuite/ext/hash_map.cc [deleted file]
libstdc++-v3/testsuite/ext/hash_map/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/hash_map/14648.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/hash_map/instantiate.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/hash_set.cc [deleted file]
libstdc++-v3/testsuite/ext/hash_set/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/hash_set/check_construct_destroy.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/hash_set/instantiate.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/hash_set_explicit_instantiation.cc [deleted file]
libstdc++-v3/testsuite/ext/headers.cc
libstdc++-v3/testsuite/ext/slist/check_construct_destroy.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/slist/instantiate.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/slist_check_construct_destroy.cc [deleted file]
libstdc++-v3/testsuite/ext/slist_explicit_instantiation.cc [deleted file]

index 31a9db02ad32f4e76ea5d7da68a961bc5f596ba0..7159783e1493d14c1ac7b7364e78822ef68d14f9 100644 (file)
@@ -1,3 +1,22 @@
+2004-10-14  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * testsuite/ext/headers.cc: Add includes, compile only.
+       * testsuite/ext/hash_map.cc: Move to...
+       * testsuite/ext/hash_map/1.cc: ...here.
+       * testsuite/ext/14648.cc: Move to...
+       * testsuite/ext/hash_map/14648.cc: ...here.
+       * testsuite/ext/hash_map/instantiate.cc: Add.
+       * testsuite/ext/hash_set.cc: Move to...
+       * testsuite/ext/hash_set/1.cc: ...here.
+       * testsuite/ext/hash_set_explicit_instantiation.cc: Move to...
+       * testsuite/ext/hash_set/instantiate.cc: ...here.
+       * testsuite/ext/hash_check_construct_destroy.cc: Move to...
+       * testsuite/ext/hash_set/check_construct_destroy.cc: ...here.
+       * testsuite/ext/slist_check_construct_destroy.cc: Move to...
+       * testsuite/ext/slist/check_construct_destroy.cc: ...here.
+       * testsuite/ext/slist_explicit_instantiation.cc: Move to...
+       * testsuite/ext/slist/instantiate.cc: ...here.
+       
 2004-10-14  Benjamin Kosnik  <bkoz@redhat.com>
 
        * include/ext/mt_allocator.h: Tweaks.
diff --git a/libstdc++-v3/testsuite/ext/14648.cc b/libstdc++-v3/testsuite/ext/14648.cc
deleted file mode 100644 (file)
index e54e2f8..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (C) 2004 Free Software Foundation
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-#include <iostream>
-#include <ext/hash_map> 
-#include <ext/rope> 
-
-// libstdc++/14648
-void test01() 
-{ 
-  using namespace std; 
-  using namespace __gnu_cxx;
-
-  typedef hash_map<char, crope, hash<char>, equal_to<char> > maptype; 
-  maptype m; 
-  m['l'] = "50";
-  m['x'] = "10";
-  cout << "m['x'] = " << m['x'] << endl; 
-}  
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/ext/hash_check_construct_destroy.cc b/libstdc++-v3/testsuite/ext/hash_check_construct_destroy.cc
deleted file mode 100644 (file)
index d95273e..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-// 2004-07-26  Matt Austern  <austern@apple.com>
-//
-// Copyright (C) 2003 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-//
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-#include <ext/hash_set>
-#include <functional>
-#include <iterator>
-#include <testsuite_allocator.h>
-
-using namespace __gnu_test;
-
-int main()
-{
-  typedef __gnu_cxx::hash_set<int, __gnu_cxx::hash<int>, std::equal_to<int>,
-                              tracker_alloc<int> >
-    Container;
-
-  const int arr10[10]  = { 2, 4, 1, 7, 3, 8, 10, 5, 9, 6 };
-  const int arr10a[10] = { 31, 23, 82, 46, 13, 17, 30, 71, 22, 51 };
-  bool ok = true;
-
-  int buckets;
-
-  allocation_tracker::resetCounts();
-  {
-    Container c;
-    buckets = c.bucket_count();
-    ok = check_construct_destroy("empty container", buckets, 0) && ok;
-  }
-  ok = check_construct_destroy("empty container", buckets, buckets) && ok;
-
-
-  allocation_tracker::resetCounts();
-  {
-    Container c(arr10, arr10 + 10);
-    ok = check_construct_destroy("Construct from range", buckets+10, 0) && ok;
-  }
-  ok = check_construct_destroy("Construct from range", buckets+10, buckets+10) && ok;
-
-  allocation_tracker::resetCounts();
-  {
-    Container c(arr10, arr10 + 10);
-    c.insert(arr10a[0]);
-    ok = check_construct_destroy("Insert element", buckets+11, 0) && ok;
-  }
-  ok = check_construct_destroy("Insert element", buckets+11, buckets+11) && ok;
-
-  allocation_tracker::resetCounts();
-  {
-    Container c(arr10, arr10 + 10);
-    c.insert(arr10a, arr10a+3);
-    ok = check_construct_destroy("Insert short range", buckets+13, 0) && ok;
-  }
-  ok = check_construct_destroy("Insert short range", buckets+13, buckets+13) && ok;
-
-  allocation_tracker::resetCounts();
-  {
-    Container c(arr10, arr10 + 10);
-    c.insert(arr10a, arr10a+10);
-    ok = check_construct_destroy("Insert long range", buckets+20, 0) && ok;
-  }
-  ok = check_construct_destroy("Insert long range", buckets+20, buckets+20) && ok;
-
-  return ok ? 0 : 1;
-}
-
diff --git a/libstdc++-v3/testsuite/ext/hash_map.cc b/libstdc++-v3/testsuite/ext/hash_map.cc
deleted file mode 100644 (file)
index 2a0bc0b..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright (C) 2002 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// hash_map (SGI extension)
-
-#include <cstdlib>
-#include <string>
-#include <ext/hash_map>
-#include <testsuite_hooks.h>
-
-using namespace std;
-using namespace __gnu_cxx;
-
-namespace __gnu_cxx 
-{
-  inline size_t hash_string(const char* s)
-  {
-    unsigned long h; 
-    for (h=0; *s; ++s) {
-      h = 5*h + *s;
-    }
-    return size_t(h);
-  }
-
-  template<class T> struct hash<T *>
-  {
-    size_t operator()(const T *const & s) const
-      { return reinterpret_cast<size_t>(s); }
-  };    
-  
-  template<> struct hash<string>
-  {
-    size_t operator()(const string &s) const { return hash_string(s.c_str()); }
-  };
-
-  template<> struct hash<const string>
-  {
-    size_t operator()(const string &s) const { return hash_string(s.c_str()); }
-  };
-
-  template<class T1, class T2> struct hash<pair<T1,T2> >
-  {
-    hash<T1> __fh;
-    hash<T2> __sh;
-    size_t operator()(const pair<T1,T2> &p) const { 
-      return __fh(p.first) ^ __sh(p.second);
-    }
-  };
-}
-
-
-const int Size = 5;
-
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  for (int i = 0; i < 10; i++)
-  {
-    hash_map<string,int> a;
-    hash_map<string,int> b;
-    
-    vector<pair<string,int> > contents (Size);
-    for (int j = 0; j < Size; j++)
-    {
-      string s;
-      for (int k = 0; k < 10; k++)
-      {
-        s += 'a' + (rand() % 26);
-      }
-      contents[j] = make_pair(s,j);
-    }
-    for (int j = 0; j < Size; j++)
-    {
-      a[contents[j].first] = contents[j].second;
-      int k = Size - 1 - j;
-      b[contents[k].first] = contents[k].second;
-    }
-    VERIFY( a == b );
-  }
-}
-
-#if !__GXX_WEAK__ && _MT_ALLOCATOR_H
-// Explicitly instantiate for systems with no COMDAT or weak support.
-template class __gnu_cxx::__mt_alloc<__gnu_cxx::_Hashtable_node<std::pair<const std::string, int> > >;
-template class __gnu_cxx::__mt_alloc<__gnu_cxx::_Hashtable_node<std::pair<const std::string, int> >* >;
-template class __gnu_cxx::__mt_alloc<std::pair<std::string, int> >;
-#endif
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/ext/hash_map/1.cc b/libstdc++-v3/testsuite/ext/hash_map/1.cc
new file mode 100644 (file)
index 0000000..2a0bc0b
--- /dev/null
@@ -0,0 +1,109 @@
+// Copyright (C) 2002 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// hash_map (SGI extension)
+
+#include <cstdlib>
+#include <string>
+#include <ext/hash_map>
+#include <testsuite_hooks.h>
+
+using namespace std;
+using namespace __gnu_cxx;
+
+namespace __gnu_cxx 
+{
+  inline size_t hash_string(const char* s)
+  {
+    unsigned long h; 
+    for (h=0; *s; ++s) {
+      h = 5*h + *s;
+    }
+    return size_t(h);
+  }
+
+  template<class T> struct hash<T *>
+  {
+    size_t operator()(const T *const & s) const
+      { return reinterpret_cast<size_t>(s); }
+  };    
+  
+  template<> struct hash<string>
+  {
+    size_t operator()(const string &s) const { return hash_string(s.c_str()); }
+  };
+
+  template<> struct hash<const string>
+  {
+    size_t operator()(const string &s) const { return hash_string(s.c_str()); }
+  };
+
+  template<class T1, class T2> struct hash<pair<T1,T2> >
+  {
+    hash<T1> __fh;
+    hash<T2> __sh;
+    size_t operator()(const pair<T1,T2> &p) const { 
+      return __fh(p.first) ^ __sh(p.second);
+    }
+  };
+}
+
+
+const int Size = 5;
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  for (int i = 0; i < 10; i++)
+  {
+    hash_map<string,int> a;
+    hash_map<string,int> b;
+    
+    vector<pair<string,int> > contents (Size);
+    for (int j = 0; j < Size; j++)
+    {
+      string s;
+      for (int k = 0; k < 10; k++)
+      {
+        s += 'a' + (rand() % 26);
+      }
+      contents[j] = make_pair(s,j);
+    }
+    for (int j = 0; j < Size; j++)
+    {
+      a[contents[j].first] = contents[j].second;
+      int k = Size - 1 - j;
+      b[contents[k].first] = contents[k].second;
+    }
+    VERIFY( a == b );
+  }
+}
+
+#if !__GXX_WEAK__ && _MT_ALLOCATOR_H
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template class __gnu_cxx::__mt_alloc<__gnu_cxx::_Hashtable_node<std::pair<const std::string, int> > >;
+template class __gnu_cxx::__mt_alloc<__gnu_cxx::_Hashtable_node<std::pair<const std::string, int> >* >;
+template class __gnu_cxx::__mt_alloc<std::pair<std::string, int> >;
+#endif
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/ext/hash_map/14648.cc b/libstdc++-v3/testsuite/ext/hash_map/14648.cc
new file mode 100644 (file)
index 0000000..e54e2f8
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (C) 2004 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <iostream>
+#include <ext/hash_map> 
+#include <ext/rope> 
+
+// libstdc++/14648
+void test01() 
+{ 
+  using namespace std; 
+  using namespace __gnu_cxx;
+
+  typedef hash_map<char, crope, hash<char>, equal_to<char> > maptype; 
+  maptype m; 
+  m['l'] = "50";
+  m['x'] = "10";
+  cout << "m['x'] = " << m['x'] << endl; 
+}  
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/ext/hash_map/instantiate.cc b/libstdc++-v3/testsuite/ext/hash_map/instantiate.cc
new file mode 100644 (file)
index 0000000..c7a11be
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright (C) 2004 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// This file tests explicit instantiation of library containers
+
+#include <ext/hash_map>
+
+// { dg-do compile }
+
+template class __gnu_cxx::hash_map<int, char>;
diff --git a/libstdc++-v3/testsuite/ext/hash_set.cc b/libstdc++-v3/testsuite/ext/hash_set.cc
deleted file mode 100644 (file)
index 9db82b7..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// 2002-04-28  Paolo Carlini  <pcarlini@unitus.it>
-//             Peter Schmid  <schmid@snake.iap.physik.tu-darmstadt.de>
-
-// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// hash_set (SGI extension)
-
-#include <ext/hash_set>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-  const int werte[] = { 1, 25, 9, 16, -36};
-  const int anzahl = sizeof(werte) / sizeof(int);
-  __gnu_cxx::hash_set<int> intTable(werte, werte + anzahl);
-}
-                                       
-#if !__GXX_WEAK__ && _MT_ALLOCATOR_H
-// Explicitly instantiate for systems with no COMDAT or weak support.
-template class __gnu_cxx::__mt_alloc<__gnu_cxx::_Hashtable_node<int> >;
-template class __gnu_cxx::__mt_alloc<__gnu_cxx::_Hashtable_node<int>* >;
-#endif
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/ext/hash_set/1.cc b/libstdc++-v3/testsuite/ext/hash_set/1.cc
new file mode 100644 (file)
index 0000000..9db82b7
--- /dev/null
@@ -0,0 +1,45 @@
+// 2002-04-28  Paolo Carlini  <pcarlini@unitus.it>
+//             Peter Schmid  <schmid@snake.iap.physik.tu-darmstadt.de>
+
+// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// hash_set (SGI extension)
+
+#include <ext/hash_set>
+
+void
+test01()
+{
+  bool test __attribute__((unused)) = true;
+  const int werte[] = { 1, 25, 9, 16, -36};
+  const int anzahl = sizeof(werte) / sizeof(int);
+  __gnu_cxx::hash_set<int> intTable(werte, werte + anzahl);
+}
+                                       
+#if !__GXX_WEAK__ && _MT_ALLOCATOR_H
+// Explicitly instantiate for systems with no COMDAT or weak support.
+template class __gnu_cxx::__mt_alloc<__gnu_cxx::_Hashtable_node<int> >;
+template class __gnu_cxx::__mt_alloc<__gnu_cxx::_Hashtable_node<int>* >;
+#endif
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/ext/hash_set/check_construct_destroy.cc b/libstdc++-v3/testsuite/ext/hash_set/check_construct_destroy.cc
new file mode 100644 (file)
index 0000000..d95273e
--- /dev/null
@@ -0,0 +1,91 @@
+// 2004-07-26  Matt Austern  <austern@apple.com>
+//
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <ext/hash_set>
+#include <functional>
+#include <iterator>
+#include <testsuite_allocator.h>
+
+using namespace __gnu_test;
+
+int main()
+{
+  typedef __gnu_cxx::hash_set<int, __gnu_cxx::hash<int>, std::equal_to<int>,
+                              tracker_alloc<int> >
+    Container;
+
+  const int arr10[10]  = { 2, 4, 1, 7, 3, 8, 10, 5, 9, 6 };
+  const int arr10a[10] = { 31, 23, 82, 46, 13, 17, 30, 71, 22, 51 };
+  bool ok = true;
+
+  int buckets;
+
+  allocation_tracker::resetCounts();
+  {
+    Container c;
+    buckets = c.bucket_count();
+    ok = check_construct_destroy("empty container", buckets, 0) && ok;
+  }
+  ok = check_construct_destroy("empty container", buckets, buckets) && ok;
+
+
+  allocation_tracker::resetCounts();
+  {
+    Container c(arr10, arr10 + 10);
+    ok = check_construct_destroy("Construct from range", buckets+10, 0) && ok;
+  }
+  ok = check_construct_destroy("Construct from range", buckets+10, buckets+10) && ok;
+
+  allocation_tracker::resetCounts();
+  {
+    Container c(arr10, arr10 + 10);
+    c.insert(arr10a[0]);
+    ok = check_construct_destroy("Insert element", buckets+11, 0) && ok;
+  }
+  ok = check_construct_destroy("Insert element", buckets+11, buckets+11) && ok;
+
+  allocation_tracker::resetCounts();
+  {
+    Container c(arr10, arr10 + 10);
+    c.insert(arr10a, arr10a+3);
+    ok = check_construct_destroy("Insert short range", buckets+13, 0) && ok;
+  }
+  ok = check_construct_destroy("Insert short range", buckets+13, buckets+13) && ok;
+
+  allocation_tracker::resetCounts();
+  {
+    Container c(arr10, arr10 + 10);
+    c.insert(arr10a, arr10a+10);
+    ok = check_construct_destroy("Insert long range", buckets+20, 0) && ok;
+  }
+  ok = check_construct_destroy("Insert long range", buckets+20, buckets+20) && ok;
+
+  return ok ? 0 : 1;
+}
+
diff --git a/libstdc++-v3/testsuite/ext/hash_set/instantiate.cc b/libstdc++-v3/testsuite/ext/hash_set/instantiate.cc
new file mode 100644 (file)
index 0000000..e59a152
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright (C) 2004 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// This file tests explicit instantiation of library containers
+
+#include <ext/hash_set>
+
+// { dg-do compile }
+
+template class __gnu_cxx::hash_set<int>;
diff --git a/libstdc++-v3/testsuite/ext/hash_set_explicit_instantiation.cc b/libstdc++-v3/testsuite/ext/hash_set_explicit_instantiation.cc
deleted file mode 100644 (file)
index e59a152..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (C) 2004 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// This file tests explicit instantiation of library containers
-
-#include <ext/hash_set>
-
-// { dg-do compile }
-
-template class __gnu_cxx::hash_set<int>;
index 52f6028bd123ff3257873ad83e412ce7b0421e7b..5315f96a238dfd4c49bd62a28cb196f65299ae83 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-do compile }
 // 1999-06-23 bkoz 
 
 // Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc.
 #include <ext/slist>
 #include <ext/debug_allocator.h>
 #include <ext/malloc_allocator.h>
+#include <ext/new_allocator.h>
+#include <ext/array_allocator.h>
 #include <ext/mt_allocator.h>
 #include <ext/pool_allocator.h>
 #include <ext/stdio_filebuf.h>
 #include <ext/stdio_sync_filebuf.h>
 
-int main() { }
diff --git a/libstdc++-v3/testsuite/ext/slist/check_construct_destroy.cc b/libstdc++-v3/testsuite/ext/slist/check_construct_destroy.cc
new file mode 100644 (file)
index 0000000..174c4da
--- /dev/null
@@ -0,0 +1,87 @@
+// 2004-07-26  Matt Austern  <austern@apple.com>
+//
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <ext/slist>
+#include <iterator>
+#include <testsuite_allocator.h>
+
+using namespace __gnu_test;
+
+int main()
+{
+  typedef __gnu_cxx::slist<int, tracker_alloc<int> > Container;
+  const int arr10[10] = { 2, 4, 1, 7, 3, 8, 10, 5, 9, 6 };
+  bool ok = true;
+
+  allocation_tracker::resetCounts();
+  {
+    Container c;
+    ok = check_construct_destroy("empty container", 0, 0) && ok;
+  }
+  ok = check_construct_destroy("empty container", 0, 0) && ok;
+
+
+  allocation_tracker::resetCounts();
+  {
+    Container c(arr10, arr10 + 10);
+    ok = check_construct_destroy("Construct from range", 10, 0) && ok;
+  }
+  ok = check_construct_destroy("Construct from range", 10, 10) && ok;
+
+  {
+    Container c(arr10, arr10 + 10);
+    allocation_tracker::resetCounts();
+    c.insert(c.begin(), arr10[0]);
+    ok = check_construct_destroy("Insert element", 1, 0) && ok;
+  }
+  ok = check_construct_destroy("Insert element", 1, 11) && ok;
+
+  {
+    Container c(arr10, arr10 + 10);
+    allocation_tracker::resetCounts();
+    Container::iterator i5 = c.begin();
+    std::advance(i5, 5);
+    c.insert(i5, arr10, arr10+3);
+    ok = check_construct_destroy("Insert short range", 3, 0) && ok;
+  }
+  ok = check_construct_destroy("Insert short range", 3, 13) && ok;
+
+  {
+    Container c(arr10, arr10 + 10);
+    allocation_tracker::resetCounts();
+    Container::iterator i7 = c.begin();
+    std::advance(i7, 5);
+    c.insert(i7, arr10, arr10+10);
+    ok = check_construct_destroy("Insert long range", 10, 0) && ok;
+  }
+  ok = check_construct_destroy("Insert long range", 10, 20) && ok;
+
+  return ok ? 0 : 1;
+}
+
diff --git a/libstdc++-v3/testsuite/ext/slist/instantiate.cc b/libstdc++-v3/testsuite/ext/slist/instantiate.cc
new file mode 100644 (file)
index 0000000..e31f526
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright (C) 2004 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// This file tests explicit instantiation of library containers
+
+#include <ext/slist>
+
+// { dg-do compile }
+
+template class __gnu_cxx::slist<int>;
diff --git a/libstdc++-v3/testsuite/ext/slist_check_construct_destroy.cc b/libstdc++-v3/testsuite/ext/slist_check_construct_destroy.cc
deleted file mode 100644 (file)
index 174c4da..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-// 2004-07-26  Matt Austern  <austern@apple.com>
-//
-// Copyright (C) 2003 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-//
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-#include <ext/slist>
-#include <iterator>
-#include <testsuite_allocator.h>
-
-using namespace __gnu_test;
-
-int main()
-{
-  typedef __gnu_cxx::slist<int, tracker_alloc<int> > Container;
-  const int arr10[10] = { 2, 4, 1, 7, 3, 8, 10, 5, 9, 6 };
-  bool ok = true;
-
-  allocation_tracker::resetCounts();
-  {
-    Container c;
-    ok = check_construct_destroy("empty container", 0, 0) && ok;
-  }
-  ok = check_construct_destroy("empty container", 0, 0) && ok;
-
-
-  allocation_tracker::resetCounts();
-  {
-    Container c(arr10, arr10 + 10);
-    ok = check_construct_destroy("Construct from range", 10, 0) && ok;
-  }
-  ok = check_construct_destroy("Construct from range", 10, 10) && ok;
-
-  {
-    Container c(arr10, arr10 + 10);
-    allocation_tracker::resetCounts();
-    c.insert(c.begin(), arr10[0]);
-    ok = check_construct_destroy("Insert element", 1, 0) && ok;
-  }
-  ok = check_construct_destroy("Insert element", 1, 11) && ok;
-
-  {
-    Container c(arr10, arr10 + 10);
-    allocation_tracker::resetCounts();
-    Container::iterator i5 = c.begin();
-    std::advance(i5, 5);
-    c.insert(i5, arr10, arr10+3);
-    ok = check_construct_destroy("Insert short range", 3, 0) && ok;
-  }
-  ok = check_construct_destroy("Insert short range", 3, 13) && ok;
-
-  {
-    Container c(arr10, arr10 + 10);
-    allocation_tracker::resetCounts();
-    Container::iterator i7 = c.begin();
-    std::advance(i7, 5);
-    c.insert(i7, arr10, arr10+10);
-    ok = check_construct_destroy("Insert long range", 10, 0) && ok;
-  }
-  ok = check_construct_destroy("Insert long range", 10, 20) && ok;
-
-  return ok ? 0 : 1;
-}
-
diff --git a/libstdc++-v3/testsuite/ext/slist_explicit_instantiation.cc b/libstdc++-v3/testsuite/ext/slist_explicit_instantiation.cc
deleted file mode 100644 (file)
index e31f526..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (C) 2004 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// This file tests explicit instantiation of library containers
-
-#include <ext/slist>
-
-// { dg-do compile }
-
-template class __gnu_cxx::slist<int>;