From 571c91a8c118f50c4d5594f62d2073179961979a Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Tue, 6 Jun 2006 22:42:27 +0000 Subject: 5_numerical_facilies: Move to... 2006-06-06 Benjamin Kosnik * testsuite/tr1/5_numerical_facilies: Move to... * testsuite/tr1/5_numerical_facilities: ...this. From-SVN: r114451 --- libstdc++-v3/ChangeLog | 5 ++ .../discard_block/requirements/requirements.cc | 40 ---------------- .../random/linear_congruential/cons/default.cc | 43 ----------------- .../random/linear_congruential/cons/gen1.cc | 50 -------------------- .../random/linear_congruential/cons/seed1.cc | 40 ---------------- .../random/linear_congruential/cons/seed2.cc | 40 ---------------- .../random/linear_congruential/operators/equal.cc | 44 ------------------ .../linear_congruential/operators/not_equal.cc | 44 ------------------ .../linear_congruential/operators/serialize.cc | 50 -------------------- .../requirements/non_uint_neg.cc | 44 ------------------ .../linear_congruential/requirements/typedefs.cc | 34 -------------- .../random/mersenne_twister/cons/default.cc | 48 ------------------- .../random/mersenne_twister/cons/gen1.cc | 54 ---------------------- .../random/mersenne_twister/cons/seed1.cc | 44 ------------------ .../random/mersenne_twister/cons/seed2.cc | 45 ------------------ .../mersenne_twister/requirements/typedefs.cc | 38 --------------- .../tr1/5_numerical_facilies/random/minstd_rand.cc | 43 ----------------- .../5_numerical_facilies/random/minstd_rand0.cc | 43 ----------------- .../tr1/5_numerical_facilies/random/mt19937.cc | 43 ----------------- .../tr1/5_numerical_facilies/random/ranlux3.cc | 44 ------------------ .../tr1/5_numerical_facilies/random/ranlux4.cc | 43 ----------------- .../random/subtract_with_carry/cons/default.cc | 43 ----------------- .../random/subtract_with_carry/cons/gen1.cc | 50 -------------------- .../random/subtract_with_carry/cons/seed1.cc | 40 ---------------- .../random/subtract_with_carry/cons/seed2.cc | 41 ---------------- .../random/subtract_with_carry/operators/equal.cc | 50 -------------------- .../subtract_with_carry/operators/not_equal.cc | 43 ----------------- .../subtract_with_carry/operators/serialize.cc | 51 -------------------- .../subtract_with_carry/requirements/typedefs.cc | 34 -------------- .../random/uniform_int/cons/default.cc | 42 ----------------- .../random/uniform_int/cons/range.cc | 42 ----------------- .../random/uniform_int/cons/range_neg.cc | 42 ----------------- .../random/uniform_int/requirements/typedefs.cc | 37 --------------- .../random/uniform_real/requirements/typedefs.cc | 37 --------------- .../variate_generator/requirements/typedefs.cc | 42 ----------------- .../random/xor_combine/requirements/typedefs.cc | 40 ---------------- .../discard_block/requirements/requirements.cc | 40 ++++++++++++++++ .../random/linear_congruential/cons/default.cc | 43 +++++++++++++++++ .../random/linear_congruential/cons/gen1.cc | 50 ++++++++++++++++++++ .../random/linear_congruential/cons/seed1.cc | 40 ++++++++++++++++ .../random/linear_congruential/cons/seed2.cc | 40 ++++++++++++++++ .../random/linear_congruential/operators/equal.cc | 44 ++++++++++++++++++ .../linear_congruential/operators/not_equal.cc | 44 ++++++++++++++++++ .../linear_congruential/operators/serialize.cc | 50 ++++++++++++++++++++ .../requirements/non_uint_neg.cc | 44 ++++++++++++++++++ .../linear_congruential/requirements/typedefs.cc | 34 ++++++++++++++ .../random/mersenne_twister/cons/default.cc | 48 +++++++++++++++++++ .../random/mersenne_twister/cons/gen1.cc | 54 ++++++++++++++++++++++ .../random/mersenne_twister/cons/seed1.cc | 44 ++++++++++++++++++ .../random/mersenne_twister/cons/seed2.cc | 45 ++++++++++++++++++ .../mersenne_twister/requirements/typedefs.cc | 38 +++++++++++++++ .../5_numerical_facilities/random/minstd_rand.cc | 43 +++++++++++++++++ .../5_numerical_facilities/random/minstd_rand0.cc | 43 +++++++++++++++++ .../tr1/5_numerical_facilities/random/mt19937.cc | 43 +++++++++++++++++ .../tr1/5_numerical_facilities/random/ranlux3.cc | 44 ++++++++++++++++++ .../tr1/5_numerical_facilities/random/ranlux4.cc | 43 +++++++++++++++++ .../random/subtract_with_carry/cons/default.cc | 43 +++++++++++++++++ .../random/subtract_with_carry/cons/gen1.cc | 50 ++++++++++++++++++++ .../random/subtract_with_carry/cons/seed1.cc | 40 ++++++++++++++++ .../random/subtract_with_carry/cons/seed2.cc | 41 ++++++++++++++++ .../random/subtract_with_carry/operators/equal.cc | 50 ++++++++++++++++++++ .../subtract_with_carry/operators/not_equal.cc | 43 +++++++++++++++++ .../subtract_with_carry/operators/serialize.cc | 51 ++++++++++++++++++++ .../subtract_with_carry/requirements/typedefs.cc | 34 ++++++++++++++ .../random/uniform_int/cons/default.cc | 42 +++++++++++++++++ .../random/uniform_int/cons/range.cc | 42 +++++++++++++++++ .../random/uniform_int/cons/range_neg.cc | 42 +++++++++++++++++ .../random/uniform_int/requirements/typedefs.cc | 37 +++++++++++++++ .../random/uniform_real/requirements/typedefs.cc | 37 +++++++++++++++ .../variate_generator/requirements/typedefs.cc | 42 +++++++++++++++++ .../random/xor_combine/requirements/typedefs.cc | 40 ++++++++++++++++ 71 files changed, 1513 insertions(+), 1508 deletions(-) delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/discard_block/requirements/requirements.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/default.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/gen1.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/seed1.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/seed2.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/operators/equal.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/operators/not_equal.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/operators/serialize.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/requirements/non_uint_neg.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/requirements/typedefs.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/default.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/gen1.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/seed1.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/seed2.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/requirements/typedefs.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mt19937.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/ranlux3.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/ranlux4.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/default.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/gen1.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/seed1.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/seed2.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/operators/equal.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/operators/not_equal.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/operators/serialize.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/requirements/typedefs.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/cons/default.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/cons/range.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/cons/range_neg.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/requirements/typedefs.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_real/requirements/typedefs.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/variate_generator/requirements/typedefs.cc delete mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/xor_combine/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/requirements.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/default.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed1.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed2.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/equal.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/not_equal.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/serialize.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/default.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed1.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed2.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand0.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mt19937.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux3.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux4.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/default.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed1.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed2.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/equal.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/not_equal.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/serialize.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/default.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/range.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/range_neg.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_real/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/variate_generator/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/typedefs.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 637f4bd..ac1cb54 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2006-06-06 Benjamin Kosnik + + * testsuite/tr1/5_numerical_facilies: Move to... + * testsuite/tr1/5_numerical_facilities: ...this. + 2006-06-06 Paolo Carlini * include/tr1/random: Trivial uglification fixes. diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/discard_block/requirements/requirements.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/discard_block/requirements/requirements.cc deleted file mode 100644 index ced6ba1..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/discard_block/requirements/requirements.cc +++ /dev/null @@ -1,40 +0,0 @@ -// { dg-do compile } -// -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.5 Class template linear_congruential -// 5.1.1 [1] Table 15 - -#include - -void -test01() -{ - using namespace std::tr1; - - typedef discard_block - < - subtract_with_carry, - 389, 24 - > test_type; - - typedef test_type::result_type result_type; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/default.cc deleted file mode 100644 index 0321b6e..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/default.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] -// 5.1.4.1 [4] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - using namespace std::tr1; - - linear_congruential x; - VERIFY( x.min() == 1 ); - VERIFY( x.max() == 2147483647-1 ); - VERIFY( x() == 48271 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/gen1.cc deleted file mode 100644 index 3d47cd6..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/gen1.cc +++ /dev/null @@ -1,50 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] -// 5.1.1 Table 16 line 3 template ctor(gen) - -#include -#include -#include - -// a not untypical initialization function -unsigned long -gen() -{ - return std::time(0); -} - -void -test01() -{ - bool test __attribute__((unused)) = true; - using namespace std::tr1; - - linear_congruential x(gen); - VERIFY( x.min() == 1 ); - VERIFY( x.max() == 2147483647-1 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/seed1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/seed1.cc deleted file mode 100644 index 5a221e1..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/seed1.cc +++ /dev/null @@ -1,40 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] -// 5.1.1 [4] para 2 - -#include -#include - -void -test01() -{ - using namespace std::tr1; - - unsigned long seed = 2; - linear_congruential x(seed); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/seed2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/seed2.cc deleted file mode 100644 index a961c31..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/cons/seed2.cc +++ /dev/null @@ -1,40 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] -// 5.1.1 [4] para 2 - -#include -#include - -void -test01() -{ - using namespace std::tr1; - - double seed = 2.0; - linear_congruential x(seed); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/operators/equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/operators/equal.cc deleted file mode 100644 index ca469ad..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/operators/equal.cc +++ /dev/null @@ -1,44 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.1 Class template linear_congruential -// 5.1 [3] Table 16 - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::tr1::minstd_rand0 a; - std::tr1::minstd_rand0 b; - std::tr1::minstd_rand0 c(120); - - VERIFY( a == b ); - VERIFY( !(a == c) ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/operators/not_equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/operators/not_equal.cc deleted file mode 100644 index 02d1970..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/operators/not_equal.cc +++ /dev/null @@ -1,44 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.1 Class template linear_congruential -// 5.1 [3] Table 16 - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::tr1::minstd_rand0 a; - std::tr1::minstd_rand0 b; - std::tr1::minstd_rand0 c(120); - - VERIFY( !(a != b) ); - VERIFY( a != c ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/operators/serialize.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/operators/serialize.cc deleted file mode 100644 index 2c40b04..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/operators/serialize.cc +++ /dev/null @@ -1,50 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.1 Class template linear_congruential -// 5.1 [3] Table 16 - -#include -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::stringstream str; - std::tr1::minstd_rand0 a; - std::tr1::minstd_rand0 b; - - a(); // advance - str << a; - - VERIFY( a != b ); - - str >> b; - VERIFY( a == b ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/requirements/non_uint_neg.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/requirements/non_uint_neg.cc deleted file mode 100644 index 94d81ed..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/requirements/non_uint_neg.cc +++ /dev/null @@ -1,44 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// { dg-do compile } -// { dg-options "-D_GLIBCXX_CONCEPT_CHECKS" } -// { dg-error "not a valid type" "" { target *-*-* } 37 } -// { dg-error "invalid type" "" { target *-*-* } 37 } - -// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] -// 5.1.4.1 [4] - -#include -#include - -void -test01() -{ - using namespace std::tr1; - - linear_congruential x; -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/requirements/typedefs.cc deleted file mode 100644 index b192c11..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/linear_congruential/requirements/typedefs.cc +++ /dev/null @@ -1,34 +0,0 @@ -// { dg-do compile } -// -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.1 Class template linear_congruential -// 5.1.1 [1] Table 15 - -#include - -void -test01() -{ - typedef std::tr1::linear_congruential test_type; - - typedef test_type::result_type result_type; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/default.cc deleted file mode 100644 index 459bb47..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/default.cc +++ /dev/null @@ -1,48 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] -// 5.1.1 Table 16 line 1 default ctor - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - using namespace std::tr1; - mersenne_twister< - unsigned long, 32, 624, 397, 31, - 0x9908b0dful, 11, 7, - 0x9d2c5680ul, 15, - 0xefc60000ul, 18> x; - - VERIFY( x.min() == 0 ); - VERIFY( x.max() == 4294967295ul ); - VERIFY( x() == 3499211612ul ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/gen1.cc deleted file mode 100644 index 0321bea..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/gen1.cc +++ /dev/null @@ -1,54 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] -// 5.1.1 Table 16 line 3 Gen ctor - -#include -#include -#include - -// a not untypical initialization function -unsigned long -gen() -{ - return std::time(0); -} - -void -test01() -{ - using namespace std::tr1; - - mersenne_twister< - unsigned long, 32, 624, 397, 31, - 0x9908b0dful, 11, 7, - 0x9d2c5680ul, 15, - 0xefc60000ul, 18> x(gen); - - VERIFY( x.min() == 0 ); - VERIFY( x.max() == 4294967295ul ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/seed1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/seed1.cc deleted file mode 100644 index 1bea796..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/seed1.cc +++ /dev/null @@ -1,44 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] -// 5.1.1 Table 16 line 2 seed ctor - -#include -#include - -void -test01() -{ - using namespace std::tr1; - - unsigned long seed = 2; - mersenne_twister< - unsigned long, 32, 624, 397, 31, - 0x9908b0dful, 11, 7, - 0x9d2c5680ul, 15, - 0xefc60000ul, 18> x(seed); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/seed2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/seed2.cc deleted file mode 100644 index d28bdfc..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/cons/seed2.cc +++ /dev/null @@ -1,45 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] -// 5.1.1 Table 16 line 2 seed ctor -// 5.1.1 (4) point 2: Gen is a fundamental type. - -#include -#include - -void -test01() -{ - using namespace std::tr1; - - double seed = 2.0; - mersenne_twister< - unsigned long, 32, 624, 397, 31, - 0x9908b0dful, 11, 7, - 0x9d2c5680ul, 15, - 0xefc60000ul, 18> x(seed); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/requirements/typedefs.cc deleted file mode 100644 index c19f016..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mersenne_twister/requirements/typedefs.cc +++ /dev/null @@ -1,38 +0,0 @@ -// { dg-do compile } -// -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.2 Class template mersenne_twister -// 5.1.1 [1] Table 15 - -#include - -void -test01() -{ - typedef std::tr1::mersenne_twister test_type; - - typedef test_type::result_type result_type; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc deleted file mode 100644 index 32b418b..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.5 Engines with predefined parameters -// 5.1.5 [1] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::tr1::minstd_rand a; - for (int i = 0; i < 9999; ++i) - a(); - - VERIFY( a() == 399268537 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc deleted file mode 100644 index 8c1b5fa..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.5 Engines with predefined parameters -// 5.1.5 [1] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::tr1::minstd_rand0 a; - for (int i = 0; i < 9999; ++i) - a(); - - VERIFY( a() == 1043618065 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mt19937.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mt19937.cc deleted file mode 100644 index a3ddb3d..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/mt19937.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.5 Engines with predefined parameters -// 5.1.5 [2] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::tr1::mt19937 a; - for (int i = 0; i < 9999; ++i) - a(); - - VERIFY( a() == 4123659995ul ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/ranlux3.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/ranlux3.cc deleted file mode 100644 index 2e2e757..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/ranlux3.cc +++ /dev/null @@ -1,44 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.5 Engines with predefined parameters -// 5.1.5 [3] - -#include -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::tr1::ranlux3 a; - for (int i = 0; i < 9999; ++i) - a(); - - VERIFY( a() == 5957620 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/ranlux4.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/ranlux4.cc deleted file mode 100644 index 6ac8fb2..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/ranlux4.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.5 Engines with predefined parameters -// 5.1.5 [3] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::tr1::ranlux4 a; - for (int i = 0; i < 9999; ++i) - a(); - - VERIFY( a() == 8587295 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/default.cc deleted file mode 100644 index 5ce9a99..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/default.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] -// 5.1.1 Table 16 line 1 default ctor - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - using namespace std::tr1; - - subtract_with_carry x; - VERIFY( x.min() == 0 ); - VERIFY( x.max() == ((1<<24)-1) ); - VERIFY( x() == 15039276 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/gen1.cc deleted file mode 100644 index 7170690..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/gen1.cc +++ /dev/null @@ -1,50 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] -// 5.1.1 Table 16 line 3 Gen ctor - -#include -#include -#include - -// a not untypical initialization function -unsigned long -gen() -{ - return std::time(0); -} - -void -test01() -{ - bool test __attribute__((unused)) = true; - using namespace std::tr1; - - subtract_with_carry x(gen); - VERIFY( x.min() == 0 ); - VERIFY( x.max() == ((1 << 24) - 1) ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/seed1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/seed1.cc deleted file mode 100644 index 61d66ef..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/seed1.cc +++ /dev/null @@ -1,40 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] -// 5.1.1 Table 16 line 2 seed ctor - -#include -#include - -void -test01() -{ - using namespace std::tr1; - - unsigned long seed = 2; - subtract_with_carry x(seed); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/seed2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/seed2.cc deleted file mode 100644 index 192a9b4..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/cons/seed2.cc +++ /dev/null @@ -1,41 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] -// 5.1.1 Table 16 line 2 seed ctor -// 5.1.1 (4) point 2: Gen is a fundamental type. - -#include -#include - -void -test01() -{ - using namespace std::tr1; - - double seed = 2.0; - subtract_with_carry x(seed); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/operators/equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/operators/equal.cc deleted file mode 100644 index 8a5b9a5..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/operators/equal.cc +++ /dev/null @@ -1,50 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] -// 5.1.1 Table 16 - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - using namespace std::tr1; - - subtract_with_carry u; - subtract_with_carry v; - - VERIFY( u == v ); - - for (int i = 0; i < 100; ++i) - { - u(); - v(); - } - VERIFY( u == v ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/operators/not_equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/operators/not_equal.cc deleted file mode 100644 index 8d5f6e0..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/operators/not_equal.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] -// 5.1.1 Table 16 - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - using namespace std::tr1; - - subtract_with_carry u(1); - subtract_with_carry v(2); - - VERIFY( u != v ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/operators/serialize.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/operators/serialize.cc deleted file mode 100644 index bbc6450..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/operators/serialize.cc +++ /dev/null @@ -1,51 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] -// 5.1.1 Table 16 - -#include -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - using std::tr1::subtract_with_carry; - - std::stringstream str; - subtract_with_carry u; - subtract_with_carry v; - - u(); // advance - str << u; - - VERIFY( u != v ); - - str >> v; - VERIFY( u == v ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/requirements/typedefs.cc deleted file mode 100644 index d7dd831..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/requirements/typedefs.cc +++ /dev/null @@ -1,34 +0,0 @@ -// { dg-do compile } -// -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.3 Class template subtract_with_carry -// 5.1.1 [1] Table 15 - -#include - -void -test01() -{ - typedef std::tr1::subtract_with_carry test_type; - - typedef test_type::result_type result_type; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/cons/default.cc deleted file mode 100644 index 1b96b54..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/cons/default.cc +++ /dev/null @@ -1,42 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.7.1 class template uniform_int -// 5.1.7.1 [2] constructors and member functions - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - using namespace std::tr1; - - uniform_int u; - VERIFY( u.min() == 0 ); - VERIFY( u.max() == 9 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/cons/range.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/cons/range.cc deleted file mode 100644 index b3a44a9..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/cons/range.cc +++ /dev/null @@ -1,42 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.7.1 class template uniform_int -// 5.1.7.1 [2] constructors and member functions - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - using namespace std::tr1; - - uniform_int u(1, 20); - VERIFY( u.min() == 1 ); - VERIFY( u.max() == 20 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/cons/range_neg.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/cons/range_neg.cc deleted file mode 100644 index 4beb1ba..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/cons/range_neg.cc +++ /dev/null @@ -1,42 +0,0 @@ -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// { dg-do run { xfail *-*-* } } -// { dg-options "-D_GLIBCXX_DEBUG" } - -// 5.1.7.1 class template uniform_int -// 5.1.7.1 [2] constructors and member functions - -#include -#include - -void -test01() -{ - using namespace std::tr1; - - uniform_int u(20, 1); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/requirements/typedefs.cc deleted file mode 100644 index 86a09cd..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_int/requirements/typedefs.cc +++ /dev/null @@ -1,37 +0,0 @@ -// { dg-do compile } -// -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.7.1 Class template uniform_int -// 5.1.1 [7] Table 17 - -#include - -void -test01() -{ - using namespace std::tr1; - - typedef uniform_int test_type; - - typedef test_type::input_type input_type; - typedef test_type::result_type result_type; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_real/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_real/requirements/typedefs.cc deleted file mode 100644 index b1ca8f4..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/uniform_real/requirements/typedefs.cc +++ /dev/null @@ -1,37 +0,0 @@ -// { dg-do compile } -// -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.7.6 Class template uniform_int [tr.rand.dist.runif] -// 5.1.1 [7] Table 17 - -#include - -void -test01() -{ - using namespace std::tr1; - - typedef uniform_real test_type; - - typedef test_type::input_type input_type; - typedef test_type::result_type result_type; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/variate_generator/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/variate_generator/requirements/typedefs.cc deleted file mode 100644 index a92c7e5..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/variate_generator/requirements/typedefs.cc +++ /dev/null @@ -1,42 +0,0 @@ -// { dg-do compile } -// -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.3 class template variate_generator - -#include - -void -test01() -{ - using namespace std::tr1; - - typedef variate_generator - < - linear_congruential, - uniform_int - > test_type; - - typedef test_type::engine_type engine_type; - typedef test_type::engine_value_type engine_value_type; - typedef test_type::distribution_type distribution_type; - typedef test_type::result_type result_type; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/xor_combine/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/xor_combine/requirements/typedefs.cc deleted file mode 100644 index 0665f8e..0000000 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilies/random/xor_combine/requirements/typedefs.cc +++ /dev/null @@ -1,40 +0,0 @@ -// { dg-do compile } -// -// 2006-06-04 Stephen M. Webb -// -// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 5.1.4.6 Class template xor_combine -// 5.1.1 [1] Table 15 - -#include - -void -test01() -{ - using namespace std::tr1; - - typedef xor_combine - < - subtract_with_carry, 1, - linear_congruential, 2 - > test_type; - - typedef test_type::result_type result_type; -} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/requirements.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/requirements.cc new file mode 100644 index 0000000..ced6ba1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/requirements.cc @@ -0,0 +1,40 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.5 Class template linear_congruential +// 5.1.1 [1] Table 15 + +#include + +void +test01() +{ + using namespace std::tr1; + + typedef discard_block + < + subtract_with_carry, + 389, 24 + > test_type; + + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/default.cc new file mode 100644 index 0000000..0321b6e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/default.cc @@ -0,0 +1,43 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] +// 5.1.4.1 [4] + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + linear_congruential x; + VERIFY( x.min() == 1 ); + VERIFY( x.max() == 2147483647-1 ); + VERIFY( x() == 48271 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc new file mode 100644 index 0000000..3d47cd6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc @@ -0,0 +1,50 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] +// 5.1.1 Table 16 line 3 template ctor(gen) + +#include +#include +#include + +// a not untypical initialization function +unsigned long +gen() +{ + return std::time(0); +} + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + linear_congruential x(gen); + VERIFY( x.min() == 1 ); + VERIFY( x.max() == 2147483647-1 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed1.cc new file mode 100644 index 0000000..5a221e1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed1.cc @@ -0,0 +1,40 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] +// 5.1.1 [4] para 2 + +#include +#include + +void +test01() +{ + using namespace std::tr1; + + unsigned long seed = 2; + linear_congruential x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed2.cc new file mode 100644 index 0000000..a961c31 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed2.cc @@ -0,0 +1,40 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] +// 5.1.1 [4] para 2 + +#include +#include + +void +test01() +{ + using namespace std::tr1; + + double seed = 2.0; + linear_congruential x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/equal.cc new file mode 100644 index 0000000..ca469ad --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/equal.cc @@ -0,0 +1,44 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.1 Class template linear_congruential +// 5.1 [3] Table 16 + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::minstd_rand0 a; + std::tr1::minstd_rand0 b; + std::tr1::minstd_rand0 c(120); + + VERIFY( a == b ); + VERIFY( !(a == c) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/not_equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/not_equal.cc new file mode 100644 index 0000000..02d1970 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/not_equal.cc @@ -0,0 +1,44 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.1 Class template linear_congruential +// 5.1 [3] Table 16 + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::minstd_rand0 a; + std::tr1::minstd_rand0 b; + std::tr1::minstd_rand0 c(120); + + VERIFY( !(a != b) ); + VERIFY( a != c ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/serialize.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/serialize.cc new file mode 100644 index 0000000..2c40b04 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/serialize.cc @@ -0,0 +1,50 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.1 Class template linear_congruential +// 5.1 [3] Table 16 + +#include +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::stringstream str; + std::tr1::minstd_rand0 a; + std::tr1::minstd_rand0 b; + + a(); // advance + str << a; + + VERIFY( a != b ); + + str >> b; + VERIFY( a == b ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc new file mode 100644 index 0000000..94d81ed --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc @@ -0,0 +1,44 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// { dg-do compile } +// { dg-options "-D_GLIBCXX_CONCEPT_CHECKS" } +// { dg-error "not a valid type" "" { target *-*-* } 37 } +// { dg-error "invalid type" "" { target *-*-* } 37 } + +// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] +// 5.1.4.1 [4] + +#include +#include + +void +test01() +{ + using namespace std::tr1; + + linear_congruential x; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/typedefs.cc new file mode 100644 index 0000000..b192c11 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/typedefs.cc @@ -0,0 +1,34 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.1 Class template linear_congruential +// 5.1.1 [1] Table 15 + +#include + +void +test01() +{ + typedef std::tr1::linear_congruential test_type; + + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/default.cc new file mode 100644 index 0000000..459bb47 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/default.cc @@ -0,0 +1,48 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] +// 5.1.1 Table 16 line 1 default ctor + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + using namespace std::tr1; + mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> x; + + VERIFY( x.min() == 0 ); + VERIFY( x.max() == 4294967295ul ); + VERIFY( x() == 3499211612ul ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc new file mode 100644 index 0000000..0321bea --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc @@ -0,0 +1,54 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] +// 5.1.1 Table 16 line 3 Gen ctor + +#include +#include +#include + +// a not untypical initialization function +unsigned long +gen() +{ + return std::time(0); +} + +void +test01() +{ + using namespace std::tr1; + + mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> x(gen); + + VERIFY( x.min() == 0 ); + VERIFY( x.max() == 4294967295ul ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed1.cc new file mode 100644 index 0000000..1bea796 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed1.cc @@ -0,0 +1,44 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] +// 5.1.1 Table 16 line 2 seed ctor + +#include +#include + +void +test01() +{ + using namespace std::tr1; + + unsigned long seed = 2; + mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed2.cc new file mode 100644 index 0000000..d28bdfc --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed2.cc @@ -0,0 +1,45 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] +// 5.1.1 Table 16 line 2 seed ctor +// 5.1.1 (4) point 2: Gen is a fundamental type. + +#include +#include + +void +test01() +{ + using namespace std::tr1; + + double seed = 2.0; + mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/typedefs.cc new file mode 100644 index 0000000..c19f016 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/typedefs.cc @@ -0,0 +1,38 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.2 Class template mersenne_twister +// 5.1.1 [1] Table 15 + +#include + +void +test01() +{ + typedef std::tr1::mersenne_twister test_type; + + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand.cc new file mode 100644 index 0000000..32b418b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand.cc @@ -0,0 +1,43 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.5 Engines with predefined parameters +// 5.1.5 [1] + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::minstd_rand a; + for (int i = 0; i < 9999; ++i) + a(); + + VERIFY( a() == 399268537 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand0.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand0.cc new file mode 100644 index 0000000..8c1b5fa --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand0.cc @@ -0,0 +1,43 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.5 Engines with predefined parameters +// 5.1.5 [1] + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::minstd_rand0 a; + for (int i = 0; i < 9999; ++i) + a(); + + VERIFY( a() == 1043618065 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mt19937.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mt19937.cc new file mode 100644 index 0000000..a3ddb3d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mt19937.cc @@ -0,0 +1,43 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.5 Engines with predefined parameters +// 5.1.5 [2] + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::mt19937 a; + for (int i = 0; i < 9999; ++i) + a(); + + VERIFY( a() == 4123659995ul ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux3.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux3.cc new file mode 100644 index 0000000..2e2e757 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux3.cc @@ -0,0 +1,44 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.5 Engines with predefined parameters +// 5.1.5 [3] + +#include +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::ranlux3 a; + for (int i = 0; i < 9999; ++i) + a(); + + VERIFY( a() == 5957620 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux4.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux4.cc new file mode 100644 index 0000000..6ac8fb2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux4.cc @@ -0,0 +1,43 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.5 Engines with predefined parameters +// 5.1.5 [3] + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::ranlux4 a; + for (int i = 0; i < 9999; ++i) + a(); + + VERIFY( a() == 8587295 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/default.cc new file mode 100644 index 0000000..5ce9a99 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/default.cc @@ -0,0 +1,43 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 line 1 default ctor + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + subtract_with_carry x; + VERIFY( x.min() == 0 ); + VERIFY( x.max() == ((1<<24)-1) ); + VERIFY( x() == 15039276 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc new file mode 100644 index 0000000..7170690 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc @@ -0,0 +1,50 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 line 3 Gen ctor + +#include +#include +#include + +// a not untypical initialization function +unsigned long +gen() +{ + return std::time(0); +} + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + subtract_with_carry x(gen); + VERIFY( x.min() == 0 ); + VERIFY( x.max() == ((1 << 24) - 1) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed1.cc new file mode 100644 index 0000000..61d66ef --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed1.cc @@ -0,0 +1,40 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 line 2 seed ctor + +#include +#include + +void +test01() +{ + using namespace std::tr1; + + unsigned long seed = 2; + subtract_with_carry x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed2.cc new file mode 100644 index 0000000..192a9b4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed2.cc @@ -0,0 +1,41 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 line 2 seed ctor +// 5.1.1 (4) point 2: Gen is a fundamental type. + +#include +#include + +void +test01() +{ + using namespace std::tr1; + + double seed = 2.0; + subtract_with_carry x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/equal.cc new file mode 100644 index 0000000..8a5b9a5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/equal.cc @@ -0,0 +1,50 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + subtract_with_carry u; + subtract_with_carry v; + + VERIFY( u == v ); + + for (int i = 0; i < 100; ++i) + { + u(); + v(); + } + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/not_equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/not_equal.cc new file mode 100644 index 0000000..8d5f6e0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/not_equal.cc @@ -0,0 +1,43 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + subtract_with_carry u(1); + subtract_with_carry v(2); + + VERIFY( u != v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/serialize.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/serialize.cc new file mode 100644 index 0000000..bbc6450 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/serialize.cc @@ -0,0 +1,51 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 + +#include +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::subtract_with_carry; + + std::stringstream str; + subtract_with_carry u; + subtract_with_carry v; + + u(); // advance + str << u; + + VERIFY( u != v ); + + str >> v; + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/typedefs.cc new file mode 100644 index 0000000..d7dd831 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/typedefs.cc @@ -0,0 +1,34 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.3 Class template subtract_with_carry +// 5.1.1 [1] Table 15 + +#include + +void +test01() +{ + typedef std::tr1::subtract_with_carry test_type; + + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/default.cc new file mode 100644 index 0000000..1b96b54 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/default.cc @@ -0,0 +1,42 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.7.1 class template uniform_int +// 5.1.7.1 [2] constructors and member functions + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + uniform_int u; + VERIFY( u.min() == 0 ); + VERIFY( u.max() == 9 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/range.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/range.cc new file mode 100644 index 0000000..b3a44a9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/range.cc @@ -0,0 +1,42 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.7.1 class template uniform_int +// 5.1.7.1 [2] constructors and member functions + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + uniform_int u(1, 20); + VERIFY( u.min() == 1 ); + VERIFY( u.max() == 20 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/range_neg.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/range_neg.cc new file mode 100644 index 0000000..4beb1ba --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/range_neg.cc @@ -0,0 +1,42 @@ +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// { dg-do run { xfail *-*-* } } +// { dg-options "-D_GLIBCXX_DEBUG" } + +// 5.1.7.1 class template uniform_int +// 5.1.7.1 [2] constructors and member functions + +#include +#include + +void +test01() +{ + using namespace std::tr1; + + uniform_int u(20, 1); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/requirements/typedefs.cc new file mode 100644 index 0000000..86a09cd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/requirements/typedefs.cc @@ -0,0 +1,37 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.7.1 Class template uniform_int +// 5.1.1 [7] Table 17 + +#include + +void +test01() +{ + using namespace std::tr1; + + typedef uniform_int test_type; + + typedef test_type::input_type input_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_real/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_real/requirements/typedefs.cc new file mode 100644 index 0000000..b1ca8f4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_real/requirements/typedefs.cc @@ -0,0 +1,37 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.7.6 Class template uniform_int [tr.rand.dist.runif] +// 5.1.1 [7] Table 17 + +#include + +void +test01() +{ + using namespace std::tr1; + + typedef uniform_real test_type; + + typedef test_type::input_type input_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/variate_generator/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/variate_generator/requirements/typedefs.cc new file mode 100644 index 0000000..a92c7e5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/variate_generator/requirements/typedefs.cc @@ -0,0 +1,42 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.3 class template variate_generator + +#include + +void +test01() +{ + using namespace std::tr1; + + typedef variate_generator + < + linear_congruential, + uniform_int + > test_type; + + typedef test_type::engine_type engine_type; + typedef test_type::engine_value_type engine_value_type; + typedef test_type::distribution_type distribution_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/typedefs.cc new file mode 100644 index 0000000..0665f8e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/typedefs.cc @@ -0,0 +1,40 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb +// +// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 5.1.4.6 Class template xor_combine +// 5.1.1 [1] Table 15 + +#include + +void +test01() +{ + using namespace std::tr1; + + typedef xor_combine + < + subtract_with_carry, 1, + linear_congruential, 2 + > test_type; + + typedef test_type::result_type result_type; +} -- cgit v1.1