This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFA:] (take 2) Make 23_containers/set/modifiers/16728.cc not time out nonnatively plus testsuite feature
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 6 Feb 2007 03:34:14 +0100
- Subject: [RFA:] (take 2) Make 23_containers/set/modifiers/16728.cc not time out nonnatively plus testsuite feature
:ADDPATCH libstdc++ testsuite:
See <URL:http://gcc.gnu.org/ml/gcc-patches/2007-02/msg00450.html>
and discussion; this is in effect a s/!native/simulator/,
introducing and using the new "target simulator" discriminator,
which uses a board-specific cookie, thus more precise.
Tested as mentioned nah, host and target.
Ok to commit? Or make it 10 iterations everywhere?
libstdc++-v3:
* testsuite/23_containers/set/modifiers/16728.cc: Use only 10
iterations for simulator targets.
gcc/testsuite:
* lib/target-supports.exp (check_effective_target_simulator): New.
Index: testsuite/23_containers/set/modifiers/16728.cc
===================================================================
--- testsuite/23_containers/set/modifiers/16728.cc (revision 121581)
+++ testsuite/23_containers/set/modifiers/16728.cc (working copy)
@@ -38,8 +38,14 @@ using namespace std;
typedef int test_type;
+// This can take extremely long on simulators, timing out the test.
+// { dg-options "-DITERATIONS=10" { target simulator } }
+#ifndef ITERATIONS
+#define ITERATIONS 10000
+#endif
+
// The number of iterations to be performed.
-int iterations = 10000;
+int iterations = ITERATIONS;
// The number of values to insert in the container, 32 will cause 5
// (re)allocations to be performed (sizes 4, 8, 16, 32 and 64)
Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp (revision 121581)
+++ lib/target-supports.exp (working copy)
@@ -2091,3 +2091,22 @@ proc check_effective_target_stdint_types
uint8_t e; uint16_t f; uint32_t g; uint64_t h;
}]
}
+
+# Return 1 if programs are intended to be run on a simulator
+# (i.e. slowly) rather than hardware (i.e. fast).
+
+proc check_effective_target_simulator { } {
+
+ # All "src/sim" simulators sets this one.
+ if [board_info target exists is_simulator] {
+ return [board_info target is_simulator]
+ }
+
+ # The "sid" simulators don't set that one, but at least they set
+ # this one.
+ if [board_info target exists slow_simulator] {
+ return [board_info target slow_simulator]
+ }
+
+ return 0
+}
brgds, H-P