This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
PATCH: Restrain iterations for nth_element/2.cc
- From: mitchell at codesourcery dot com (Mark Mitchell)
- To: libstdc++ at gcc dot gnu dot org
- Date: Fri, 29 Aug 2008 22:37:25 -0700 (PDT)
- Subject: PATCH: Restrain iterations for nth_element/2.cc
- Reply-to: mark at codesourcery dot com
This test sometimes times out when running in the GDB ARM simulator,
depending on machine load. This patch constrains the number of
iterations when running in a simulator, as we do for other tests.
OK to apply?
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
2008-08-29 Mark Mitchell <mark@codesourcery.com>
* testsuite/25_algorithms/nth_element/2.cc: Constrain iterations
when testing on a simultor.
Index: 2.cc
===================================================================
--- 2.cc (revision 219450)
+++ 2.cc (working copy)
@@ -18,6 +18,12 @@
// 25.3.2 [lib.alg.nth.element]
+// { dg-options "-DMAX_SIZE=256" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE (1 << 10)
+#endif
+
#include <vector>
#include <algorithm>
#include <testsuite_hooks.h>
@@ -64,7 +70,7 @@ do_test01(unsigned size)
void
test01()
{
- for (unsigned size = 4; size <= 1 << 10; size <<= 1)
+ for (unsigned size = 4; size <= MAX_SIZE; size <<= 1)
do_test01(size);
}