* [patch, libstdc++ testsuite] Shrink tests for simulator
@ 2012-12-13 18:42 Steve Ellcey
2012-12-13 19:27 ` Paolo Carlini
0 siblings, 1 reply; 3+ messages in thread
From: Steve Ellcey @ 2012-12-13 18:42 UTC (permalink / raw)
To: libstdc++, gcc-patches
I have been running the libstdc++ testsuite using the gnu simulator for
my mips-mti-elf target. Some of the tests fail due to the amount of
memory they need and I would like to 'shrink' them when run on a
simulator using the same technique I see other tests using. These
four tests aren't the only ones that fail for me but I wanted to send
this patch first to see if this approach was acceptable before changing
any more tests.
OK to checkin?
Steve Ellcey
sellcey@mips.com
2012-12-13 Steve Ellcey <sellcey@mips.com>
* 21_strings/basic_string/capacity/char/18654.cc: Shrink memory
usage under simulator.
* 21_strings/basic_string/capacity/wchar_t/18654.cc: Ditto.
* 22_locale/collate/transform/char/28277.cc: Ditto.
* 22_locale/collate/transform/wchar_t/28277.cc: Ditto.
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc
index e9fa200..78af79a 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc
@@ -19,6 +19,12 @@
// 21.3.3 string capacity
+// { dg-options "-DMAX_SIZE=16" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE 20
+#endif
+
#include <string>
#include <testsuite_hooks.h>
@@ -34,7 +40,7 @@ void test01()
// and shrink-to-fit (in the future, maybe this will change
// for short strings).
const size_type minsize = 2 << 0;
- const size_type maxsize = 2 << 20;
+ const size_type maxsize = 2 << MAX_SIZE;
for (size_type i = minsize; i <= maxsize; i *= 2)
{
string str(i, 'x');
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc
index fd51175..df75f09 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc
@@ -19,6 +19,12 @@
// 21.3.3 string capacity
+// { dg-options "-DMAX_SIZE=16" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE 20
+#endif
+
#include <string>
#include <testsuite_hooks.h>
@@ -34,7 +40,7 @@ void test01()
// and shrink-to-fit (in the future, maybe this will change
// for short strings).
const size_type minsize = 2 << 0;
- const size_type maxsize = 2 << 20;
+ const size_type maxsize = 2 << MAX_SIZE;
for (size_type i = minsize; i <= maxsize; i *= 2)
{
wstring str(i, L'x');
diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/char/28277.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/char/28277.cc
index bf8c494..7b94c7d 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/transform/char/28277.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/transform/char/28277.cc
@@ -19,6 +19,12 @@
// 22.2.4.1.1 collate members
+// { dg-options "-DMAX_SIZE=1000000" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE 10000000
+#endif
+
#include <locale>
#include <testsuite_hooks.h>
@@ -36,7 +42,7 @@ void test01()
// cache the collate facets
const collate<char>& coll_c = use_facet<collate<char> >(loc_c);
- const string_type sstr(10000000, 'a');
+ const string_type sstr(MAX_SIZE, 'a');
const string_type dstr = coll_c.transform(sstr.data(),
sstr.data() + sstr.size());
diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/28277.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/28277.cc
index 4f21169..56ad605 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/28277.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/28277.cc
@@ -19,6 +19,12 @@
// 22.2.4.1.1 collate members
+// { dg-options "-DMAX_SIZE=100000" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE 10000000
+#endif
+
#include <locale>
#include <testsuite_hooks.h>
@@ -36,7 +42,7 @@ void test01()
// cache the collate facets
const collate<wchar_t>& coll_c = use_facet<collate<wchar_t> >(loc_c);
- const string_type sstr(10000000, L'a');
+ const string_type sstr(MAX_SIZE, L'a');
const string_type dstr = coll_c.transform(sstr.data(),
sstr.data() + sstr.size());
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch, libstdc++ testsuite] Shrink tests for simulator
2012-12-13 18:42 [patch, libstdc++ testsuite] Shrink tests for simulator Steve Ellcey
@ 2012-12-13 19:27 ` Paolo Carlini
2012-12-13 19:58 ` Steve Ellcey
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Carlini @ 2012-12-13 19:27 UTC (permalink / raw)
To: Steve Ellcey; +Cc: libstdc++, gcc-patches
Hi,
On 12/13/2012 07:42 PM, Steve Ellcey wrote:
> I have been running the libstdc++ testsuite using the gnu simulator for
> my mips-mti-elf target. Some of the tests fail due to the amount of
> memory they need and I would like to 'shrink' them when run on a
> simulator using the same technique I see other tests using. These
> four tests aren't the only ones that fail for me but I wanted to send
> this patch first to see if this approach was acceptable before changing
> any more tests.
It's the same approach that we are following in many other places, right?
> OK to checkin?
Yes, thanks.
Paolo.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch, libstdc++ testsuite] Shrink tests for simulator
2012-12-13 19:27 ` Paolo Carlini
@ 2012-12-13 19:58 ` Steve Ellcey
0 siblings, 0 replies; 3+ messages in thread
From: Steve Ellcey @ 2012-12-13 19:58 UTC (permalink / raw)
To: Paolo Carlini; +Cc: libstdc++, gcc-patches
On Thu, 2012-12-13 at 20:27 +0100, Paolo Carlini wrote:
> It's the same approach that we are following in many other places, right?
Yes, it is the same approach.
> > OK to checkin?
> Yes, thanks.
Done.
Steve Ellcey
sellcey@mips.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-12-13 19:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-13 18:42 [patch, libstdc++ testsuite] Shrink tests for simulator Steve Ellcey
2012-12-13 19:27 ` Paolo Carlini
2012-12-13 19:58 ` Steve Ellcey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).