From 300ea2831b894fc143539fe0319f39062b6e4daf Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 30 Sep 2009 00:50:24 +0000 Subject: [PATCH] random.tcc: Define static const data members. 2009-09-29 Paolo Carlini * include/bits/random.tcc: Define static const data members. * include/tr1/random.tcc: Likewise. * testsuite/26_numerics/random/subtract_with_carry_engine/ requirements/constants.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/ requirements/constants.cc: Likewise. * testsuite/26_numerics/random/linear_congruential_engine/ requirements/constants.cc: Likewise. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constants.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/ requirements/constants.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/constants.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/discard_block/ requirements/constants.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/linear_congruential/ requirements/constants.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/mersenne_twister/ requirements/constants.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/xor_combine/ requirements/constants.cc: Likewise. From-SVN: r152317 --- libstdc++-v3/ChangeLog | 35 +++- libstdc++-v3/include/bits/random.tcc | 172 ++++++++++++++++++ libstdc++-v3/include/tr1/random.tcc | 133 ++++++++++++++ .../requirements/constants.cc | 40 ++++ .../requirements/constants.cc | 50 +++++ .../requirements/constants.cc | 38 ++++ .../requirements/constants.cc | 40 ++++ .../discard_block/requirements/constants.cc | 36 ++++ .../requirements/constants.cc | 37 ++++ .../requirements/constants.cc | 45 +++++ .../requirements/constants.cc | 37 ++++ .../requirements/constants.cc | 37 ++++ .../xor_combine/requirements/constants.cc | 37 ++++ 13 files changed, 732 insertions(+), 5 deletions(-) create mode 100644 libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/constants.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/requirements/constants.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/requirements/constants.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/requirements/constants.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/constants.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/constants.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/constants.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/constants.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/requirements/constants.cc create mode 100644 libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/constants.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 04239e502ab2..6cdbedf0c6ff 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,4 +1,29 @@ -2009-09-30 Ralf Wildenhues +2009-09-29 Paolo Carlini + + * include/bits/random.tcc: Define static const data members. + * include/tr1/random.tcc: Likewise. + * testsuite/26_numerics/random/subtract_with_carry_engine/ + requirements/constants.cc: New. + * testsuite/26_numerics/random/mersenne_twister_engine/ + requirements/constants.cc: Likewise. + * testsuite/26_numerics/random/linear_congruential_engine/ + requirements/constants.cc: Likewise. + * testsuite/26_numerics/random/shuffle_order_engine/requirements/ + constants.cc: Likewise. + * testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/ + requirements/constants.cc: Likewise. + * testsuite/tr1/5_numerical_facilities/random/ + subtract_with_carry_01/requirements/constants.cc: Likewise. + * testsuite/tr1/5_numerical_facilities/random/discard_block/ + requirements/constants.cc: Likewise. + * testsuite/tr1/5_numerical_facilities/random/linear_congruential/ + requirements/constants.cc: Likewise. + * testsuite/tr1/5_numerical_facilities/random/mersenne_twister/ + requirements/constants.cc: Likewise. + * testsuite/tr1/5_numerical_facilities/random/xor_combine/ + requirements/constants.cc: Likewise. + +2009-09-29 Ralf Wildenhues PR libstdc++/38923 * acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Avoid 'head', @@ -8,10 +33,10 @@ 2009-09-28 Benjamin Kosnik - * libsupc++/eh_terminate.cc: Fixes for -fno-exceptions. - * libsupc++/vec.cc: Same. - * libsupc++/vterminate.cc: Same. - * libsupc++/new_opnt.cc: Same. + * libsupc++/eh_terminate.cc: Fixes for -fno-exceptions. + * libsupc++/vec.cc: Same. + * libsupc++/vterminate.cc: Same. + * libsupc++/new_opnt.cc: Same. 2009-09-28 Johannes Singler diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc index e4c39612b7fb..712426ec9b64 100644 --- a/libstdc++-v3/include/bits/random.tcc +++ b/libstdc++-v3/include/bits/random.tcc @@ -89,6 +89,23 @@ namespace std }; } // namespace __detail + + template + const _UIntType + linear_congruential_engine<_UIntType, __a, __c, __m>::multiplier; + + template + const _UIntType + linear_congruential_engine<_UIntType, __a, __c, __m>::increment; + + template + const _UIntType + linear_congruential_engine<_UIntType, __a, __c, __m>::modulus; + + template + const _UIntType + linear_congruential_engine<_UIntType, __a, __c, __m>::default_seed; + /** * Seeds the LCR with integral value @p __s, adjusted so that the * ring identity is never a member of the convergence set. @@ -169,6 +186,133 @@ namespace std } + template + const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::word_size; + + template + const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::state_size; + + template + const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::shift_size; + + template + const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::mask_bits; + + template + const _UIntType + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::xor_mask; + + template + const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::tempering_u; + + template + const _UIntType + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::tempering_d; + + template + const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::tempering_s; + + template + const _UIntType + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::tempering_b; + + template + const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::tempering_t; + + template + const _UIntType + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::tempering_c; + + template + const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::tempering_l; + + template + const _UIntType + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>:: + initialization_multiplier; + + template + const _UIntType + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, + __s, __b, __t, __c, __l, __f>::default_seed; + template + const size_t + subtract_with_carry_engine<_UIntType, __w, __s, __r>::word_size; + + template + const size_t + subtract_with_carry_engine<_UIntType, __w, __s, __r>::short_lag; + + template + const size_t + subtract_with_carry_engine<_UIntType, __w, __s, __r>::long_lag; + + template + const _UIntType + subtract_with_carry_engine<_UIntType, __w, __s, __r>::default_seed; + template void subtract_with_carry_engine<_UIntType, __w, __s, __r>:: @@ -474,6 +634,14 @@ namespace std } + template + const size_t + discard_block_engine<_RandomNumberEngine, __p, __r>::block_size; + + template + const size_t + discard_block_engine<_RandomNumberEngine, __p, __r>::used_block; + template typename discard_block_engine<_RandomNumberEngine, __p, __r>::result_type @@ -576,6 +744,10 @@ namespace std } + template + const size_t + shuffle_order_engine<_RandomNumberEngine, __k>::table_size; + template typename shuffle_order_engine<_RandomNumberEngine, __k>::result_type shuffle_order_engine<_RandomNumberEngine, __k>:: diff --git a/libstdc++-v3/include/tr1/random.tcc b/libstdc++-v3/include/tr1/random.tcc index 855f48c7b51a..818777d3e227 100644 --- a/libstdc++-v3/include/tr1/random.tcc +++ b/libstdc++-v3/include/tr1/random.tcc @@ -89,6 +89,19 @@ namespace tr1 }; } // namespace __detail + + template + const _UIntType + linear_congruential<_UIntType, __a, __c, __m>::multiplier; + + template + const _UIntType + linear_congruential<_UIntType, __a, __c, __m>::increment; + + template + const _UIntType + linear_congruential<_UIntType, __a, __c, __m>::modulus; + /** * Seeds the LCR with integral value @p __x0, adjusted so that the * ring identity is never a member of the convergence set. @@ -174,6 +187,83 @@ namespace tr1 } + template + const int + mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s, + __b, __t, __c, __l>::word_size; + + template + const int + mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s, + __b, __t, __c, __l>::state_size; + + template + const int + mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s, + __b, __t, __c, __l>::shift_size; + + template + const int + mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s, + __b, __t, __c, __l>::mask_bits; + + template + const _UIntType + mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s, + __b, __t, __c, __l>::parameter_a; + + template + const int + mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s, + __b, __t, __c, __l>::output_u; + + template + const int + mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s, + __b, __t, __c, __l>::output_s; + + template + const _UIntType + mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s, + __b, __t, __c, __l>::output_b; + + template + const int + mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s, + __b, __t, __c, __l>::output_t; + + template + const _UIntType + mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s, + __b, __t, __c, __l>::output_c; + + template + const int + mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s, + __b, __t, __c, __l>::output_l; + template @@ -311,6 +401,18 @@ namespace tr1 } + template + const _IntType + subtract_with_carry<_IntType, __m, __s, __r>::modulus; + + template + const int + subtract_with_carry<_IntType, __m, __s, __r>::long_lag; + + template + const int + subtract_with_carry<_IntType, __m, __s, __r>::short_lag; + template void subtract_with_carry<_IntType, __m, __s, __r>:: @@ -431,6 +533,18 @@ namespace tr1 } + template + const int + subtract_with_carry_01<_RealType, __w, __s, __r>::word_size; + + template + const int + subtract_with_carry_01<_RealType, __w, __s, __r>::long_lag; + + template + const int + subtract_with_carry_01<_RealType, __w, __s, __r>::short_lag; + template void subtract_with_carry_01<_RealType, __w, __s, __r>:: @@ -576,6 +690,13 @@ namespace tr1 return __is; } + template + const int + discard_block<_UniformRandomNumberGenerator, __p, __r>::block_size; + + template + const int + discard_block<_UniformRandomNumberGenerator, __p, __r>::used_block; template typename discard_block<_UniformRandomNumberGenerator, @@ -639,6 +760,18 @@ namespace tr1 } + template + const int + xor_combine<_UniformRandomNumberGenerator1, __s1, + _UniformRandomNumberGenerator2, __s2>::shift1; + + template + const int + xor_combine<_UniformRandomNumberGenerator1, __s1, + _UniformRandomNumberGenerator2, __s2>::shift2; + template void diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/constants.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/constants.cc new file mode 100644 index 000000000000..af0c4b1e356c --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/constants.cc @@ -0,0 +1,40 @@ +// { dg-do link } +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2009-09-29 Paolo Carlini +// +// Copyright (C) 2009 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 3, 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 COPYING3. If not see +// . + +#include + +void test01() +{ + std::minstd_rand0 lc; + + const void* p = &lc.multiplier; + p = &lc.increment; + p = &lc.modulus; + p = &lc.default_seed; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/requirements/constants.cc b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/requirements/constants.cc new file mode 100644 index 000000000000..2abc5ab9b647 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/requirements/constants.cc @@ -0,0 +1,50 @@ +// { dg-do link } +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2009-09-29 Paolo Carlini +// +// Copyright (C) 2009 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 3, 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 COPYING3. If not see +// . + +#include + +void test01() +{ + std::mt19937 mt; + + const void* p = &mt.word_size; + p = &mt.state_size; + p = &mt.shift_size; + p = &mt.mask_bits; + p = &mt.xor_mask; + p = &mt.tempering_u; + p = &mt.tempering_d; + p = &mt.tempering_s; + p = &mt.tempering_b; + p = &mt.tempering_t; + p = &mt.tempering_c; + p = &mt.tempering_l; + p = &mt.initialization_multiplier; + p = &mt.default_seed; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/requirements/constants.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/requirements/constants.cc new file mode 100644 index 000000000000..c1d5b3a2e450 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/requirements/constants.cc @@ -0,0 +1,38 @@ +// { dg-do link } +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2009-09-29 Paolo Carlini +// +// Copyright (C) 2009 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 3, 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 COPYING3. If not see +// . + +#include + +void test01() +{ + std::knuth_b so; + + const void* p = &so.table_size; + p = &so.table_size; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/requirements/constants.cc b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/requirements/constants.cc new file mode 100644 index 000000000000..2ab13a30309e --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/requirements/constants.cc @@ -0,0 +1,40 @@ +// { dg-do link } +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2009-09-29 Paolo Carlini +// +// Copyright (C) 2009 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 3, 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 COPYING3. If not see +// . + +#include + +void test01() +{ + std::ranlux24_base swc; + + const void* p = &swc.word_size; + p = &swc.short_lag; + p = &swc.long_lag; + p = &swc.default_seed; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/constants.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/constants.cc new file mode 100644 index 000000000000..2c43732041c5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/constants.cc @@ -0,0 +1,36 @@ +// { dg-do link } +// +// 2009-09-29 Paolo Carlini +// +// Copyright (C) 2009 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 3, 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 COPYING3. If not see +// . + +#include + +void test01() +{ + std::tr1::ranlux3 db; + + const void* p = &db.block_size; + p = &db.used_block; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/constants.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/constants.cc new file mode 100644 index 000000000000..c38254f13d4d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/constants.cc @@ -0,0 +1,37 @@ +// { dg-do link } +// +// 2009-09-29 Paolo Carlini +// +// Copyright (C) 2009 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 3, 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 COPYING3. If not see +// . + +#include + +void test01() +{ + std::tr1::minstd_rand0 lc; + + const void* p = &lc.multiplier; + p = &lc.increment; + p = &lc.modulus; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/constants.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/constants.cc new file mode 100644 index 000000000000..9ebddd8c6d0d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/constants.cc @@ -0,0 +1,45 @@ +// { dg-do link } +// +// 2009-09-29 Paolo Carlini +// +// Copyright (C) 2009 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 3, 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 COPYING3. If not see +// . + +#include + +void test01() +{ + std::tr1::mt19937 mt; + + const void* p = &mt.word_size; + p = &mt.state_size; + p = &mt.shift_size; + p = &mt.mask_bits; + p = &mt.parameter_a; + p = &mt.output_u; + p = &mt.output_s; + p = &mt.output_b; + p = &mt.output_t; + p = &mt.output_c; + p = &mt.output_l; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/constants.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/constants.cc new file mode 100644 index 000000000000..c68002d2766f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/constants.cc @@ -0,0 +1,37 @@ +// { dg-do link } +// +// 2009-09-29 Paolo Carlini +// +// Copyright (C) 2009 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 3, 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 COPYING3. If not see +// . + +#include + +void test01() +{ + std::tr1::subtract_with_carry swc; + + const void* p = &swc.modulus; + p = &swc.long_lag; + p = &swc.short_lag; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/requirements/constants.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/requirements/constants.cc new file mode 100644 index 000000000000..c1715264d3ab --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/requirements/constants.cc @@ -0,0 +1,37 @@ +// { dg-do link } +// +// 2009-09-29 Paolo Carlini +// +// Copyright (C) 2009 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 3, 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 COPYING3. If not see +// . + +#include + +void test01() +{ + std::tr1::ranlux_base_01 swc_01; + + const void* p = &swc_01.word_size; + p = &swc_01.long_lag; + p = &swc_01.short_lag; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/constants.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/constants.cc new file mode 100644 index 000000000000..0318b0d5e18d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/constants.cc @@ -0,0 +1,37 @@ +// { dg-do link } +// +// 2009-09-29 Paolo Carlini +// +// Copyright (C) 2009 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 3, 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 COPYING3. If not see +// . + +#include + +void test01() +{ + std::tr1::xor_combine + xor_c; + + const void* p = &xor_c.shift1; + p = &xor_c.shift2; +} + +int main() +{ + test01(); + return 0; +}