]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
vector.cc: Shrink memory usage under simulator.
authorSteve Ellcey <sje@gcc.gnu.org>
Mon, 14 Jan 2013 20:57:58 +0000 (20:57 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Mon, 14 Jan 2013 20:57:58 +0000 (20:57 +0000)
2013-01-14  Steve Ellcey  <sellcey@mips.com>

* testsuite/libstdc++-v3/testsuite/23_containers/vector/profile/vector.cc:
Shrink memory usage under simulator.
* testsuite/libstdc++-v3/testsuite/26_numerics/valarray/28277.cc: Ditto.
* testsuite/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/wchar_t/4.cc:
Ditto.
* testsuite/libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/5.cc:
Ditto.
* testsuite/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/2.cc:
Ditto.
* testsuite/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-1.cc:
Ditto.
* testsuite/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-2.cc:
Ditto.
* testsuite/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/wchar_t/1.cc:
Ditto.
* testsuite/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/wchar_t/4.cc:
Ditto.

From-SVN: r195177

libstdc++-v3/testsuite/23_containers/vector/profile/vector.cc
libstdc++-v3/testsuite/26_numerics/valarray/28277.cc
libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/wchar_t/4.cc
libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/5.cc
libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/2.cc
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-1.cc
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-2.cc
libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/wchar_t/1.cc
libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/wchar_t/4.cc

index 1e9d01afec59cf08d3a4e39459cf9e764268301b..7806fb24bf35cd93054a6b3a1b3e9abc854c7566 100644 (file)
@@ -1,6 +1,12 @@
 // Test vector: performance difference 25% (0.444s vs 0.539s)
 // Advice: set tmp as 10000
 
+// { dg-options "-DITERATIONS=20" { target simulator } }
+
+#ifndef ITERATIONS
+#define ITERATIONS 2000
+#endif
+
 #include <vector>
 
 using std::vector;
@@ -9,7 +15,7 @@ int main()
 {
   vector <int> tmp;
 
-  for (int j=0; j<2000; j++)
+  for (int j=0; j<ITERATIONS; j++)
     // Insert more than default item
     for (int i=0; i<10000; i++) {
       tmp.push_back(i);
index 7e619c0208ff25c8f8e202608af6a646ae745aa2..2712a5de4e62c451d8d3ad750b9d8182d9189997 100644 (file)
@@ -1,6 +1,6 @@
 // 2006-07-15  Paolo Carlini  <pcarlini@suse.de>
 
-// Copyright (C) 2006, 2009 Free Software Foundation
+// Copyright (C) 2006, 2009, 2013 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// { dg-options "-DMAX_SIZE=5000" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE 5000000
+#endif
+
 #include <valarray>
 #include <testsuite_hooks.h>
 
@@ -25,7 +31,7 @@ void test01()
 {
   bool test __attribute__((unused)) = true;
 
-  const std::valarray<int> v1(1, 5000000);
+  const std::valarray<int> v1(1, MAX_SIZE);
 
   const std::valarray<int> v2 = v1.shift(1);
   VERIFY( v2.size() == v1.size() );
index 2e27c800e8cee6153bab409770040136dcec21c1..58c100d9f8fb12fd0ea9bc099cff145d171d93c3 100644 (file)
@@ -1,6 +1,6 @@
 // 2005-07-22  Paolo Carlini  <pcarlini@suse.de>
 
-// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation
+// Copyright (C) 2005, 2006, 2007, 2009, 2013 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
 
 // 27.6.1.2.3 basic_istream::operator>>
 
+// { dg-options "-DMAX_SIZE=466" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE 666
+#endif
+
 #include <istream>
 #include <string>
 #include <fstream>
@@ -70,7 +76,7 @@ void test01()
   const char filename[] = "inserters_extractors-4.txt";
 
   const unsigned nchunks = 10;
-  const wstring data = prepare(666, nchunks);
+  const wstring data = prepare(MAX_SIZE, nchunks);
 
   wofstream ofstrm;
   ofstrm.open(filename);
index 39fb59572608578eb4bacc228a5760e6cd145f06..0c8a047262355985f8b994d26d73a6ed13dbde80 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation
+// Copyright (C) 2004, 2005, 2006, 2007, 2009, 2013 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
 
 // 27.6.1.3 unformatted input functions
 
+// { dg-options "-DMAX_LENGTH=7" { target simulator } }
+
+#ifndef MAX_LENGTH
+#define MAX_LENGTH 777
+#endif
+
 #include <istream>
 #include <string>
 #include <fstream>
@@ -68,7 +74,7 @@ void test01()
 
   const wchar_t delim = L'|';
   const unsigned nchunks = 10;
-  const wstring data = prepare(777, nchunks, delim);
+  const wstring data = prepare(MAX_LENGTH, nchunks, delim);
 
   wofstream ofstrm;
   ofstrm.open(filename);
index 8a24210415d2a576988a56f7471e859ff82b0200..867b86e33e80c2bd7f12cc61f4c8356fc9100ad0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation
+// Copyright (C) 2004, 2005, 2006, 2007, 2009, 2013 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
 
 // 27.6.1.3 unformatted input functions
 
+// { dg-options "-DMAX_SIZE=355" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE 555
+#endif
+
 #include <istream>
 #include <string>
 #include <fstream>
@@ -67,7 +73,7 @@ void test01()
 
   const wchar_t delim = L'|';
   const unsigned nchunks = 10;
-  const wstring data = prepare(555, nchunks, delim);
+  const wstring data = prepare(MAX_SIZE, nchunks, delim);
 
   wofstream ofstrm;
   ofstrm.open(filename);
index d2658641d7c3d348a00423433dd9ff04c11a652d..8012f794b4018e1dba14c99e286f31d0c42a4e6f 100644 (file)
@@ -1,6 +1,6 @@
 // 2006-07-15  Paolo Carlini  <pcarlini@suse.de>
 
-// Copyright (C) 2006, 2009 Free Software Foundation
+// Copyright (C) 2006, 2009, 2013 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
 
 // 27.6.2.5.4 basic_ostream character inserters
 
+// { dg-options "-DMAX_SIZE=50000" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE 5000000
+#endif
+
 #include <ostream>
 #include <sstream>
 #include <testsuite_hooks.h>
@@ -30,7 +36,7 @@ void test01()
   bool test __attribute__((unused)) = true;
 
   wostringstream oss_01;
-  const string str_01(5000000, 'a');
+  const string str_01(MAX_SIZE, 'a');
 
   oss_01 << str_01.c_str();
 
index 6280fa1d71aadad8fbf962708c000a46000b3463..94b6b13eda43cd7698c24ec9fe48f0c6c814cdec 100644 (file)
@@ -1,6 +1,6 @@
 // 2006-10-12  Paolo Carlini  <pcarlini@suse.de>
 
-// Copyright (C) 2006, 2007, 2009 Free Software Foundation
+// Copyright (C) 2006, 2007, 2009, 2013 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
 
 // 27.6.2.5.4 basic_ostream character inserters
 
+// { dg-options "-DMAX_SIZE=50000" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE 5000000
+#endif
+
 #include <ostream>
 #include <sstream>
 #include <testsuite_hooks.h>
@@ -32,7 +38,7 @@ void test01()
   wostringstream oss_01;
   const string str_01(50, 'a');
 
-  oss_01.width(5000000);
+  oss_01.width(MAX_SIZE);
   const streamsize width = oss_01.width();
 
   oss_01 << str_01.c_str();
index 0d3ea89e8c6f924504b9c97612b9a7577e69b0f1..2b35dbdea184b4b48b4f2178117f50ee7bf1ba2e 100644 (file)
@@ -1,6 +1,6 @@
 // 2004-07-07  Paolo Carlini  <pcarlini@suse.de>
 
-// Copyright (C) 2004, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2009, 2013 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
 
 // 27.7.1.3 basic_stringbuf overridden virtual functions.
 
+// { dg-options "-DMAX_SIZE=100000" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE 10000000
+#endif
+
 #include <sstream>
 #include <cstdlib>
 #include <testsuite_hooks.h>
@@ -51,6 +57,6 @@ test01(unsigned iter)
 
 int main()
 {
-  test01(10000000);
+  test01(MAX_SIZE);
   return 0;
 }
index c6c966db7d1061ab4807fe53e05d770d3ef0f0f0..4a82d8f5fc70232781bccb19e557720317968de0 100644 (file)
@@ -1,6 +1,6 @@
 // 2004-10-06  Paolo Carlini  <pcarlini@suse.de>
 
-// Copyright (C) 2004, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2009, 2013 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
 
 // 27.8.1.4 Overridden virtual functions
 
+// { dg-options "-DMAX_SIZE=4096" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE (1 << 18)
+#endif
+
 #include <sstream>
 #include <testsuite_hooks.h>
 
@@ -27,7 +33,7 @@ void test01()
   using namespace std;
   bool test __attribute__((unused)) = true;
 
-  const unsigned max_size = 1 << 18;
+  const unsigned max_size = MAX_SIZE;
 
   static wchar_t ref[max_size];
   wmemset(ref, L'\0', max_size);