From 51d619308377f16a8ff13df95becfe2282198844 Mon Sep 17 00:00:00 2001 From: bstarynk Date: Mon, 17 Sep 2012 05:30:37 +0000 Subject: 2012-09-17 Basile Starynkevitch MELT branch merged with trunk rev 191371 using svnmerge. [gcc/] 2012-09-17 Basile Starynkevitch {{when merging trunk svn rev 191371}} * melt-runtime.c (melt_load_module_index): Push an empty slot, not a null pointer, into melt_modinfvec. (meltgc_run_c_extension): Push an empty slot, not a null pointer, into melt_extinfvec. (melt_really_initialize): Better indentation, and increase maximal minore size to 32768Kwords. Push an empty slot, not a null pointer, into melt_modinfvec. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@191373 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 73 ++++++ libstdc++-v3/Makefile.in | 3 +- libstdc++-v3/acinclude.m4 | 26 ++ libstdc++-v3/configure | 60 ++++- libstdc++-v3/configure.ac | 3 + libstdc++-v3/doc/Makefile.in | 3 +- libstdc++-v3/fragment.am | 2 +- libstdc++-v3/include/Makefile.in | 23 +- libstdc++-v3/include/ext/random | 279 +++++++++++++++++++-- libstdc++-v3/include/ext/random.tcc | 69 +++++ libstdc++-v3/libsupc++/Makefile.in | 3 +- libstdc++-v3/libsupc++/guard.cc | 2 +- libstdc++-v3/po/Makefile.in | 3 +- libstdc++-v3/python/Makefile.in | 3 +- libstdc++-v3/src/Makefile.in | 3 +- libstdc++-v3/src/c++11/Makefile.in | 21 +- libstdc++-v3/src/c++11/random.cc | 4 +- libstdc++-v3/src/c++98/Makefile.in | 3 +- .../random/beta_distribution/cons/default.cc | 43 ---- .../random/beta_distribution/cons/parms.cc | 43 ---- .../random/beta_distribution/operators/equal.cc | 42 ---- .../random/beta_distribution/operators/inequal.cc | 42 ---- .../beta_distribution/operators/serialize.cc | 44 ---- .../requirements/explicit_instantiation/1.cc | 26 -- .../beta_distribution/requirements/typedefs.cc | 34 --- .../random/normal_mv_distribution/cons/default.cc | 49 ---- .../random/normal_mv_distribution/cons/parms.cc | 49 ---- .../normal_mv_distribution/operators/equal.cc | 42 ---- .../normal_mv_distribution/operators/inequal.cc | 42 ---- .../normal_mv_distribution/operators/serialize.cc | 44 ---- .../requirements/explicit_instantiation/1.cc | 26 -- .../requirements/typedefs.cc | 34 --- .../simd_fast_mersenne_twister_engine/cons/copy.cc | 47 ---- .../cons/default.cc | 183 -------------- .../cons/seed1.cc | 43 ---- .../cons/seed2.cc | 43 ---- .../cons/seed_seq.cc | 43 ---- .../operators/equal.cc | 49 ---- .../operators/inequal.cc | 52 ---- .../operators/serialize.cc | 66 ----- libstdc++-v3/testsuite/Makefile.in | 3 +- .../ext/random/beta_distribution/cons/default.cc | 43 ++++ .../ext/random/beta_distribution/cons/parms.cc | 43 ++++ .../random/beta_distribution/operators/equal.cc | 42 ++++ .../random/beta_distribution/operators/inequal.cc | 42 ++++ .../beta_distribution/operators/serialize.cc | 44 ++++ .../requirements/explicit_instantiation/1.cc | 26 ++ .../beta_distribution/requirements/typedefs.cc | 34 +++ .../random/normal_mv_distribution/cons/default.cc | 49 ++++ .../random/normal_mv_distribution/cons/parms.cc | 49 ++++ .../normal_mv_distribution/operators/equal.cc | 42 ++++ .../normal_mv_distribution/operators/inequal.cc | 42 ++++ .../normal_mv_distribution/operators/serialize.cc | 44 ++++ .../requirements/explicit_instantiation/1.cc | 26 ++ .../requirements/typedefs.cc | 34 +++ .../ext/random/rice_distribution/cons/default.cc | 47 ++++ .../ext/random/rice_distribution/cons/parms.cc | 47 ++++ .../random/rice_distribution/operators/equal.cc | 44 ++++ .../random/rice_distribution/operators/inequal.cc | 44 ++++ .../rice_distribution/operators/serialize.cc | 51 ++++ .../requirements/explicit_instantiation/1.cc | 26 ++ .../rice_distribution/requirements/typedefs.cc | 36 +++ .../simd_fast_mersenne_twister_engine/cons/copy.cc | 47 ++++ .../cons/default.cc | 183 ++++++++++++++ .../cons/seed1.cc | 43 ++++ .../cons/seed2.cc | 43 ++++ .../cons/seed_seq.cc | 43 ++++ .../operators/equal.cc | 49 ++++ .../operators/inequal.cc | 52 ++++ .../operators/serialize.cc | 66 +++++ 70 files changed, 1902 insertions(+), 1151 deletions(-) delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/beta_distribution/cons/default.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/beta_distribution/cons/parms.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/beta_distribution/operators/equal.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/beta_distribution/operators/inequal.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/beta_distribution/operators/serialize.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/beta_distribution/requirements/explicit_instantiation/1.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/beta_distribution/requirements/typedefs.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/cons/default.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/cons/parms.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/operators/equal.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/operators/inequal.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/operators/serialize.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/requirements/explicit_instantiation/1.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/requirements/typedefs.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/copy.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/default.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed1.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed2.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed_seq.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/equal.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/inequal.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/serialize.cc create mode 100644 libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc create mode 100644 libstdc++-v3/testsuite/ext/random/beta_distribution/cons/parms.cc create mode 100644 libstdc++-v3/testsuite/ext/random/beta_distribution/operators/equal.cc create mode 100644 libstdc++-v3/testsuite/ext/random/beta_distribution/operators/inequal.cc create mode 100644 libstdc++-v3/testsuite/ext/random/beta_distribution/operators/serialize.cc create mode 100644 libstdc++-v3/testsuite/ext/random/beta_distribution/requirements/explicit_instantiation/1.cc create mode 100644 libstdc++-v3/testsuite/ext/random/beta_distribution/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc create mode 100644 libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/parms.cc create mode 100644 libstdc++-v3/testsuite/ext/random/normal_mv_distribution/operators/equal.cc create mode 100644 libstdc++-v3/testsuite/ext/random/normal_mv_distribution/operators/inequal.cc create mode 100644 libstdc++-v3/testsuite/ext/random/normal_mv_distribution/operators/serialize.cc create mode 100644 libstdc++-v3/testsuite/ext/random/normal_mv_distribution/requirements/explicit_instantiation/1.cc create mode 100644 libstdc++-v3/testsuite/ext/random/normal_mv_distribution/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/ext/random/rice_distribution/cons/default.cc create mode 100644 libstdc++-v3/testsuite/ext/random/rice_distribution/cons/parms.cc create mode 100644 libstdc++-v3/testsuite/ext/random/rice_distribution/operators/equal.cc create mode 100644 libstdc++-v3/testsuite/ext/random/rice_distribution/operators/inequal.cc create mode 100644 libstdc++-v3/testsuite/ext/random/rice_distribution/operators/serialize.cc create mode 100644 libstdc++-v3/testsuite/ext/random/rice_distribution/requirements/explicit_instantiation/1.cc create mode 100644 libstdc++-v3/testsuite/ext/random/rice_distribution/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/copy.cc create mode 100644 libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/default.cc create mode 100644 libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/seed1.cc create mode 100644 libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/seed2.cc create mode 100644 libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/seed_seq.cc create mode 100644 libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/operators/equal.cc create mode 100644 libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/operators/inequal.cc create mode 100644 libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/operators/serialize.cc (limited to 'libstdc++-v3') diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4ecedf818bd..128f7cb0805 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,76 @@ +2012-09-16 Edward Smith-Rowland <3dw4rd@verizon.net> + + * include/ext/random.tcc (__gnu_cxx::rice_distribution<> + ::__generate_impl): Remove bogus _Adaptor usage. + +2012-09-16 Paolo Carlini + + * include/ext/random (rice_distribution<>::operator==): Change + inline friend definition to non-template. + * testsuite/ext/random/rice_distribution/requirements/ + explicit_instantiation/1.cc: New. + + * testsuite/26_numerics/random/normal_mv_distribution: Move... + * testsuite/ext/random/normal_mv_distribution: ... here. + * testsuite/26_numerics/random/simd_fast_mersenne_twister_engine: + Move... + * testsuite/ext/random/simd_fast_mersenne_twister_engine: ... here. + * testsuite/26_numerics/random/beta_distribution: Move... + * testsuite/ext/random/beta_distribution: ... here. + * testsuite/26_numerics/random/rice_distribution: Move... + * testsuite/ext/random/rice_distribution: ... here. + +2012-09-14 Edward Smith-Rowland <3dw4rd@verizon.net> + + * include/ext/random: Add __gnu_cxx::rice_distribution<> class. + * include/ext/random.tcc: Add out-of-line functions for + __gnu_cxx::rice_distribution<>. + * testsuite/26_numerics/random/rice_distribution/ + operators/equal.cc: New file. + * testsuite/26_numerics/random/rice_distribution/ + operators/serialize.cc: New file. + * testsuite/26_numerics/random/rice_distribution/ + operators/inequal.cc: New file. + * testsuite/26_numerics/random/rice_distribution/ + cons/parms.cc: New file. + * testsuite/26_numerics/random/rice_distribution/ + cons/default.cc: New file. + * testsuite/26_numerics/random/rice_distribution/ + requirements/typedefs.cc: New file. + +2012-09-14 David Edelsohn + + * configure: Regenerated. + +2012-09-14 Jonathan Wakely + H.J. Lu + + PR libstdc++/54576 + * src/c++11/random.cc: Check if _GLIBCXX_USE_C99_STDINT_TR1 is defined. + +2012-09-12 Rainer Orth + + * acinclude.m4 (GLIBCXX_CHECK_ASSEMBLER_HWCAP): Define. + * configure.ac: Call GLIBCXX_CHECK_ASSEMBLER_HWCAP. + * fragment.am (CONFIG_CXXFLAGS): Add $(HWCAP_FLAGS). + * configure: Regenerate. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * include/Makefile.in: Regenerate. + * libsupc++/Makefile.in: Regenerate. + * po/Makefile.in: Regenerate. + * python/Makefile.in: Regenerate. + * src/Makefile.in: Regenerate. + * src/c++11/Makefile.in: Regenerate. + * src/c++98/Makefile.in: Regenerate. + * testsuite/Makefile.in: Regenerate. + +2012-09-11 Jakub Jelinek + + PR libstdc++/54172 + * libsupc++/guard.cc (__cxa_guard_acquire): Fix up the last + argument of the first __atomic_compare_exchange_n. + 2012-09-10 Sebastian Huber Jonathan Wakely diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in index 1b1c3dd09af..7870fc35c1f 100644 --- a/libstdc++-v3/Makefile.in +++ b/libstdc++-v3/Makefile.in @@ -174,6 +174,7 @@ FGREP = @FGREP@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ +HWCAP_FLAGS = @HWCAP_FLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -318,7 +319,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir) # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. CONFIG_CXXFLAGS = \ - $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ + $(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 794df5c22be..ab26660782e 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -168,6 +168,32 @@ AC_DEFUN([GLIBCXX_CHECK_COMPILER_FEATURES], [ ]) +dnl +dnl Check if the assembler used supports disabling generation of hardware +dnl capabilities. This is only supported by Sun as at the moment. +dnl +dnl Defines: +dnl HWCAP_FLAGS='-Wa,-nH' if possible. +dnl +AC_DEFUN([GLIBCXX_CHECK_ASSEMBLER_HWCAP], [ + test -z "$HWCAP_FLAGS" && HWCAP_FLAGS='' + + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wa,-nH" + + AC_MSG_CHECKING([for as that supports -Wa,-nH]) + AC_TRY_COMPILE([], [return 0;], [ac_hwcap_flags=yes],[ac_hwcap_flags=no]) + if test "$ac_hwcap_flags" = "yes"; then + HWCAP_FLAGS="-Wa,-nH $HWCAP_FLAGS" + fi + AC_MSG_RESULT($ac_hwcap_flags) + + CFLAGS="$ac_save_CFLAGS" + + AC_SUBST(HWCAP_FLAGS) +]) + + dnl dnl If GNU ld is in use, check to see if tricky linker opts can be used. If dnl the native linker is in use, all variables will be defined to something diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index ff4caf4315c..6ad3e6289fe 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -639,6 +639,7 @@ BUILD_INFO_FALSE BUILD_INFO_TRUE baseline_subdir_switch baseline_dir +HWCAP_FLAGS GLIBCXX_LDBL_COMPAT_FALSE GLIBCXX_LDBL_COMPAT_TRUE ENABLE_VISIBILITY_FALSE @@ -8534,6 +8535,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi + lt_prog_compiler_pic='-fPIC' ;; amigaos*) @@ -11507,7 +11509,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11510 "configure" +#line 11512 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11613,7 +11615,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11616 "configure" +#line 11618 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13416,6 +13418,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi + lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) @@ -14994,7 +14997,7 @@ fi # # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. cat > conftest.$ac_ext << EOF -#line 14997 "configure" +#line 15000 "configure" struct S { ~S(); }; void bar(); void foo() @@ -15329,7 +15332,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } # Fake what AC_TRY_COMPILE does. cat > conftest.$ac_ext << EOF -#line 15332 "configure" +#line 15335 "configure" int main() { typedef bool atomic_type; @@ -15364,7 +15367,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15367 "configure" +#line 15370 "configure" int main() { typedef short atomic_type; @@ -15399,7 +15402,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15402 "configure" +#line 15405 "configure" int main() { // NB: _Atomic_word not necessarily int. @@ -15435,7 +15438,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15438 "configure" +#line 15441 "configure" int main() { typedef long long atomic_type; @@ -15514,7 +15517,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 15517 "configure" +#line 15520 "configure" int main() { _Decimal32 d1; @@ -15556,7 +15559,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 15559 "configure" +#line 15562 "configure" template struct same { typedef T2 type; }; @@ -15590,7 +15593,7 @@ $as_echo "$enable_int128" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15593 "configure" +#line 15596 "configure" template struct same { typedef T2 type; }; @@ -70647,6 +70650,43 @@ $as_echo "#define _GLIBCXX_LONG_DOUBLE_COMPAT 1" >>confdefs.h esac +# Check if assembler supports disabling hardware capability support. + + test -z "$HWCAP_FLAGS" && HWCAP_FLAGS='' + + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wa,-nH" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for as that supports -Wa,-nH" >&5 +$as_echo_n "checking for as that supports -Wa,-nH... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hwcap_flags=yes +else + ac_hwcap_flags=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$ac_hwcap_flags" = "yes"; then + HWCAP_FLAGS="-Wa,-nH $HWCAP_FLAGS" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_hwcap_flags" >&5 +$as_echo "$ac_hwcap_flags" >&6; } + + CFLAGS="$ac_save_CFLAGS" + + + + # Check if assembler supports rdrand opcode. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rdrand support in assembler" >&5 diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index c09c685e099..559a811be41 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -333,6 +333,9 @@ case "$target" in esac GLIBCXX_CONDITIONAL(GLIBCXX_LDBL_COMPAT, test $ac_ldbl_compat = yes) +# Check if assembler supports disabling hardware capability support. +GLIBCXX_CHECK_ASSEMBLER_HWCAP + # Check if assembler supports rdrand opcode. GLIBCXX_CHECK_X86_RDRAND diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in index 9161e69c200..9b1c7eddec1 100644 --- a/libstdc++-v3/doc/Makefile.in +++ b/libstdc++-v3/doc/Makefile.in @@ -146,6 +146,7 @@ FGREP = @FGREP@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ +HWCAP_FLAGS = @HWCAP_FLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -300,7 +301,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir) # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. CONFIG_CXXFLAGS = \ - $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ + $(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once diff --git a/libstdc++-v3/fragment.am b/libstdc++-v3/fragment.am index 304d39637d9..64247afbe24 100644 --- a/libstdc++-v3/fragment.am +++ b/libstdc++-v3/fragment.am @@ -22,7 +22,7 @@ endif # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. CONFIG_CXXFLAGS = \ - $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ + $(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index c5537295ff9..eb8bd1f032b 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -146,6 +146,7 @@ FGREP = @FGREP@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ +HWCAP_FLAGS = @HWCAP_FLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -290,7 +291,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir) # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. CONFIG_CXXFLAGS = \ - $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ + $(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once @@ -1199,7 +1200,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/fragment.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -1235,15 +1235,10 @@ install-am: all-am installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff --git a/libstdc++-v3/include/ext/random b/libstdc++-v3/include/ext/random index 6bb438a8558..e53204074fc 100644 --- a/libstdc++-v3/include/ext/random +++ b/libstdc++-v3/include/ext/random @@ -87,7 +87,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { seed(__sd); } template::value> + std::enable_if::value> ::type> explicit simd_fast_mersenne_twister_engine(_Sseq& __q) @@ -149,7 +150,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typename _CharT, typename _Traits> friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, - const __gnu_cxx::simd_fast_mersenne_twister_engine<_UIntType_2, + const __gnu_cxx::simd_fast_mersenne_twister_engine + <_UIntType_2, __m_2, __pos1_2, __sl1_2, __sl2_2, __sr1_2, __sr2_2, __msk1_2, __msk2_2, __msk3_2, __msk4_2, __parity1_2, __parity2_2, __parity3_2, __parity4_2>& __x); @@ -531,16 +533,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } - /** - * @brief Return true if two beta distributions have the same - * parameters and the sequences that would be generated - * are equal. - */ - friend bool - operator==(const beta_distribution& __d1, - const beta_distribution& __d2) - { return __d1.param() == __d2.param(); } - /** * @brief Inserts a %beta_distribution random number distribution * @p __x into the output stream @p __os. @@ -581,14 +573,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; + /** + * @brief Return true if two beta distributions have the same + * parameters and the sequences that would be generated + * are equal. + */ + template + inline bool + operator==(const __gnu_cxx::beta_distribution<_RealType>& __d1, + const __gnu_cxx::beta_distribution<_RealType>& __d2) + { return __d1.param() == __d2.param(); } + /** * @brief Return true if two beta distributions are different. */ - template - inline bool - operator!=(const __gnu_cxx::beta_distribution<_RealType>& __d1, - const __gnu_cxx::beta_distribution<_RealType>& __d2) - { return !(__d1 == __d2); } + template + inline bool + operator!=(const __gnu_cxx::beta_distribution<_RealType>& __d1, + const __gnu_cxx::beta_distribution<_RealType>& __d2) + { return !(__d1 == __d2); } /** @@ -896,6 +899,248 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return !(__d1 == __d2); } + /** + * @brief A Rice continuous distribution for random numbers. + * + * The formula for the Rice probability density function is + * @f[ + * p(x|\nu,\sigma) = \frac{x}{\sigma^2} + * \exp\left(-\frac{x^2+\nu^2}{2\sigma^2}\right) + * I_0\left(\frac{x \nu}{\sigma^2}\right) + * @f] + * where @f$I_0(z)@f$ is the modified Bessel function of the first kind + * of order 0 and @f$\nu >= 0@f$ and @f$\sigma > 0@f$. + * + * + * + * + * + * + *
Distribution Statistics
Mean@f$\sqrt{\pi/2}L_{1/2}(-\nu^2/2\sigma^2)@f$
Variance@f$2\sigma^2 + \nu^2 + * + (\pi\sigma^2/2)L^2_{1/2}(-\nu^2/2\sigma^2)@f$
Range@f$[0, \infty)@f$
+ * where @f$L_{1/2}(x)@f$ is the Laguerre polynomial of order 1/2. + */ + template + class + rice_distribution + { + static_assert(std::is_floating_point<_RealType>::value, + "template argument not a floating point type"); + public: + /** The type of the range of the distribution. */ + typedef _RealType result_type; + /** Parameter type. */ + struct param_type + { + typedef rice_distribution distribution_type; + + param_type(result_type __nu = result_type(0), + result_type __sigma = result_type(1)) + : _M_nu(__nu), _M_sigma(__sigma) + { + _GLIBCXX_DEBUG_ASSERT(_M_nu >= result_type(0)); + _GLIBCXX_DEBUG_ASSERT(_M_sigma > result_type(0)); + } + + result_type + nu() const + { return _M_nu; } + + result_type + sigma() const + { return _M_sigma; } + + friend bool + operator==(const param_type& __p1, const param_type& __p2) + { return __p1._M_nu == __p2._M_nu + && __p1._M_sigma == __p2._M_sigma; } + + private: + void _M_initialize(); + + result_type _M_nu; + result_type _M_sigma; + }; + + /** + * @brief Constructors. + */ + explicit + rice_distribution(result_type __nu = result_type(0), + result_type __sigma = result_type(1)) + : _M_param(__nu, __sigma), + _M_ndx(__nu, __sigma), + _M_ndy(result_type(0), __sigma) + { } + + explicit + rice_distribution(const param_type& __p) + : _M_param(__p), + _M_ndx(__p.nu(), __p.sigma()), + _M_ndy(result_type(0), __p.sigma()) + { } + + /** + * @brief Resets the distribution state. + */ + void + reset() + { + _M_ndx.reset(); + _M_ndy.reset(); + } + + /** + * @brief Return the parameters of the distribution. + */ + result_type + nu() const + { return _M_param.nu(); } + + result_type + sigma() const + { return _M_param.sigma(); } + + /** + * @brief Returns the parameter set of the distribution. + */ + param_type + param() const + { return _M_param; } + + /** + * @brief Sets the parameter set of the distribution. + * @param __param The new parameter set of the distribution. + */ + void + param(const param_type& __param) + { _M_param = __param; } + + /** + * @brief Returns the greatest lower bound value of the distribution. + */ + result_type + min() const + { return result_type(0); } + + /** + * @brief Returns the least upper bound value of the distribution. + */ + result_type + max() const + { return std::numeric_limits::max(); } + + /** + * @brief Generating functions. + */ + template + result_type + operator()(_UniformRandomNumberGenerator& __urng) + { + result_type __x = this->_M_ndx(__urng); + result_type __y = this->_M_ndy(__urng); + return std::hypot(__x, __y); + } + + template + result_type + operator()(_UniformRandomNumberGenerator& __urng, + const param_type& __p) + { + typename std::normal_distribution::param_type + __px(__p.nu(), __p.sigma()), __py(result_type(0), __p.sigma()); + result_type __x = this->_M_ndx(__px, __urng); + result_type __y = this->_M_ndy(__py, __urng); + return std::hypot(__x, __y); + } + + template + void + __generate(_ForwardIterator __f, _ForwardIterator __t, + _UniformRandomNumberGenerator& __urng) + { this->__generate(__f, __t, __urng, this->param()); } + + template + void + __generate(_ForwardIterator __f, _ForwardIterator __t, + _UniformRandomNumberGenerator& __urng, + const param_type& __p) + { this->__generate_impl(__f, __t, __urng, __p); } + + template + void + __generate(result_type* __f, result_type* __t, + _UniformRandomNumberGenerator& __urng, + const param_type& __p) + { this->__generate_impl(__f, __t, __urng, __p); } + + /** + * @brief Return true if two Rice distributions have + * the same parameters and the sequences that would + * be generated are equal. + */ + friend bool + operator==(const rice_distribution& __d1, + const rice_distribution& __d2) + { return (__d1.param() == __d2.param() + && __d1._M_ndx == __d2._M_ndx + && __d1._M_ndy == __d2._M_ndy); } + + /** + * @brief Inserts a %rice_distribution random number distribution + * @p __x into the output stream @p __os. + * + * @param __os An output stream. + * @param __x A %rice_distribution random number distribution. + * + * @returns The output stream with the state of @p __x inserted or in + * an error state. + */ + template + friend std::basic_ostream<_CharT, _Traits>& + operator<<(std::basic_ostream<_CharT, _Traits>&, + const rice_distribution<_RealType1>&); + + /** + * @brief Extracts a %rice_distribution random number distribution + * @p __x from the input stream @p __is. + * + * @param __is An input stream. + * @param __x A %rice_distribution random number + * generator engine. + * + * @returns The input stream with @p __x extracted or in an error state. + */ + template + friend std::basic_istream<_CharT, _Traits>& + operator>>(std::basic_istream<_CharT, _Traits>&, + rice_distribution<_RealType1>&); + + private: + template + void + __generate_impl(_ForwardIterator __f, _ForwardIterator __t, + _UniformRandomNumberGenerator& __urng, + const param_type& __p); + + param_type _M_param; + + std::normal_distribution _M_ndx; + std::normal_distribution _M_ndy; + }; + + /** + * @brief Return true if two Rice distributions are not equal. + */ + template + inline bool + operator!=(const rice_distribution<_RealType1>& __d1, + const rice_distribution<_RealType1>& __d2) + { return !(__d1 == __d2); } + _GLIBCXX_END_NAMESPACE_VERSION } // namespace std diff --git a/libstdc++-v3/include/ext/random.tcc b/libstdc++-v3/include/ext/random.tcc index 988dc222829..24735b41120 100644 --- a/libstdc++-v3/include/ext/random.tcc +++ b/libstdc++-v3/include/ext/random.tcc @@ -751,6 +751,75 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } + template + template + void + rice_distribution<_RealType>:: + __generate_impl(_OutputIterator __f, _OutputIterator __t, + _UniformRandomNumberGenerator& __urng, + const param_type& __p) + { + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator>) + + while (__f != __t) + { + typename std::normal_distribution::param_type + __px(__p.nu(), __p.sigma()), __py(result_type(0), __p.sigma()); + result_type __x = this->_M_ndx(__px, __urng); + result_type __y = this->_M_ndy(__py, __urng); + *__f++ = std::hypot(__x, __y); + } + } + + template + std::basic_ostream<_CharT, _Traits>& + operator<<(std::basic_ostream<_CharT, _Traits>& __os, + const rice_distribution<_RealType>& __x) + { + typedef std::basic_ostream<_CharT, _Traits> __ostream_type; + typedef typename __ostream_type::ios_base __ios_base; + + const typename __ios_base::fmtflags __flags = __os.flags(); + const _CharT __fill = __os.fill(); + const std::streamsize __precision = __os.precision(); + const _CharT __space = __os.widen(' '); + __os.flags(__ios_base::scientific | __ios_base::left); + __os.fill(__space); + __os.precision(std::numeric_limits<_RealType>::max_digits10); + + __os << __x.nu() << __space << __x.sigma(); + __os << __space << __x._M_ndx; + __os << __space << __x._M_ndy; + + __os.flags(__flags); + __os.fill(__fill); + __os.precision(__precision); + return __os; + } + + template + std::basic_istream<_CharT, _Traits>& + operator>>(std::basic_istream<_CharT, _Traits>& __is, + rice_distribution<_RealType>& __x) + { + typedef std::basic_istream<_CharT, _Traits> __istream_type; + typedef typename __istream_type::ios_base __ios_base; + + const typename __ios_base::fmtflags __flags = __is.flags(); + __is.flags(__ios_base::dec | __ios_base::skipws); + + _RealType __nu, __sigma; + __is >> __nu >> __sigma; + __is >> __x._M_ndx; + __is >> __x._M_ndy; + __x.param(typename rice_distribution<_RealType>:: + param_type(__nu, __sigma)); + + __is.flags(__flags); + return __is; + } + _GLIBCXX_END_NAMESPACE_VERSION } // namespace diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in index 4399c3db057..fc53994a144 100644 --- a/libstdc++-v3/libsupc++/Makefile.in +++ b/libstdc++-v3/libsupc++/Makefile.in @@ -212,6 +212,7 @@ FGREP = @FGREP@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ +HWCAP_FLAGS = @HWCAP_FLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -356,7 +357,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir) # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. CONFIG_CXXFLAGS = \ - $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ + $(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once diff --git a/libstdc++-v3/libsupc++/guard.cc b/libstdc++-v3/libsupc++/guard.cc index 60165cdecb4..f8550c03fae 100644 --- a/libstdc++-v3/libsupc++/guard.cc +++ b/libstdc++-v3/libsupc++/guard.cc @@ -253,7 +253,7 @@ namespace __cxxabiv1 int expected(0); if (__atomic_compare_exchange_n(gi, &expected, pending_bit, false, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED)) + __ATOMIC_ACQUIRE)) { // This thread should do the initialization. return 1; diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in index 4dbaea1c15a..a03bd3829a1 100644 --- a/libstdc++-v3/po/Makefile.in +++ b/libstdc++-v3/po/Makefile.in @@ -146,6 +146,7 @@ FGREP = @FGREP@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ +HWCAP_FLAGS = @HWCAP_FLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -290,7 +291,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir) # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. CONFIG_CXXFLAGS = \ - $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ + $(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in index 9467c70494f..cf5d87116db 100644 --- a/libstdc++-v3/python/Makefile.in +++ b/libstdc++-v3/python/Makefile.in @@ -176,6 +176,7 @@ FGREP = @FGREP@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ +HWCAP_FLAGS = @HWCAP_FLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -320,7 +321,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir) # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. CONFIG_CXXFLAGS = \ - $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ + $(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index f797d19b7f8..8dbabc36949 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -205,6 +205,7 @@ FGREP = @FGREP@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ +HWCAP_FLAGS = @HWCAP_FLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -349,7 +350,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir) # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. CONFIG_CXXFLAGS = \ - $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ + $(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once diff --git a/libstdc++-v3/src/c++11/Makefile.in b/libstdc++-v3/src/c++11/Makefile.in index af26eaf002d..1d265760569 100644 --- a/libstdc++-v3/src/c++11/Makefile.in +++ b/libstdc++-v3/src/c++11/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -163,6 +163,7 @@ FGREP = @FGREP@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ +HWCAP_FLAGS = @HWCAP_FLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -307,7 +308,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir) # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. CONFIG_CXXFLAGS = \ - $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ + $(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once @@ -427,7 +428,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/fragment.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -446,7 +446,7 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libc++11convenience.la: $(libc__11convenience_la_OBJECTS) $(libc__11convenience_la_DEPENDENCIES) $(EXTRA_libc__11convenience_la_DEPENDENCIES) +libc++11convenience.la: $(libc__11convenience_la_OBJECTS) $(libc__11convenience_la_DEPENDENCIES) $(CXXLINK) $(libc__11convenience_la_OBJECTS) $(libc__11convenience_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -535,15 +535,10 @@ install-am: all-am installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff --git a/libstdc++-v3/src/c++11/random.cc b/libstdc++-v3/src/c++11/random.cc index 4342df4d546..9280e15089f 100644 --- a/libstdc++-v3/src/c++11/random.cc +++ b/libstdc++-v3/src/c++11/random.cc @@ -24,6 +24,8 @@ #include +#ifdef _GLIBCXX_USE_C99_STDINT_TR1 + #if defined __i386__ || defined __x86_64__ # include #endif @@ -142,5 +144,5 @@ namespace std _GLIBCXX_VISIBILITY(default) 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL>; - } +#endif diff --git a/libstdc++-v3/src/c++98/Makefile.in b/libstdc++-v3/src/c++98/Makefile.in index 2ee02719c44..be5781e0f5d 100644 --- a/libstdc++-v3/src/c++98/Makefile.in +++ b/libstdc++-v3/src/c++98/Makefile.in @@ -178,6 +178,7 @@ FGREP = @FGREP@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ +HWCAP_FLAGS = @HWCAP_FLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -322,7 +323,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir) # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. CONFIG_CXXFLAGS = \ - $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ + $(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once diff --git a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/cons/default.cc deleted file mode 100644 index 3aa2d851e98..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/cons/default.cc +++ /dev/null @@ -1,43 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 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 -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::beta_distribution<> u; - VERIFY( u.alpha() == 1.0 ); - VERIFY( u.beta() == 1.0 ); - VERIFY( u.min() == 0.0 ); - VERIFY( u.max() == 1.0 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/cons/parms.cc b/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/cons/parms.cc deleted file mode 100644 index 9d6c0b18da7..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/cons/parms.cc +++ /dev/null @@ -1,43 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 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 -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::beta_distribution<> u(1.5, 3.0); - VERIFY( u.alpha() == 1.5 ); - VERIFY( u.beta() == 3.0 ); - VERIFY( u.min() == 0.0 ); - VERIFY( u.max() == 1.0 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/operators/equal.cc deleted file mode 100644 index a31a6545d53..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/operators/equal.cc +++ /dev/null @@ -1,42 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-03-16 Paolo Carlini -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 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 -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::beta_distribution u(1.5, 3.0), v, w; - - VERIFY( v == w ); - VERIFY( !(u == v) ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/operators/inequal.cc deleted file mode 100644 index d7eda3935bf..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/operators/inequal.cc +++ /dev/null @@ -1,42 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-03-16 Paolo Carlini -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 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 -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::beta_distribution u(1.5, 3.0), v, w; - - VERIFY( u != v ); - VERIFY( !(v != w) ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/operators/serialize.cc deleted file mode 100644 index dd2fed8d590..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/operators/serialize.cc +++ /dev/null @@ -1,44 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2009-08-14 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 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 -#include - -void -test01() -{ - std::stringstream str; - __gnu_cxx::beta_distribution u(1.5, 3.0), v; - std::minstd_rand0 rng; - - u(rng); // advance - str << u; - - str >> v; -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/requirements/explicit_instantiation/1.cc deleted file mode 100644 index a572b1478ae..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/requirements/explicit_instantiation/1.cc +++ /dev/null @@ -1,26 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=c++11" } -// { dg-require-cstdint "" } -// -// Copyright (C) 2012 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 - -template class __gnu_cxx::beta_distribution; -template class __gnu_cxx::beta_distribution; -template class __gnu_cxx::beta_distribution; diff --git a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/requirements/typedefs.cc deleted file mode 100644 index 33b18ae535c..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/beta_distribution/requirements/typedefs.cc +++ /dev/null @@ -1,34 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 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() -{ - typedef __gnu_cxx::beta_distribution test_type; - - typedef test_type::result_type result_type; - typedef test_type::param_type param_type; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/cons/default.cc deleted file mode 100644 index a51fde40f03..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/cons/default.cc +++ /dev/null @@ -1,49 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 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 -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::normal_mv_distribution<2> u; - VERIFY( u.mean()[0] == 0.0 ); - VERIFY( u.mean()[1] == 0.0 ); - VERIFY( u.varcov()[0] == 1.0 ); - VERIFY( u.varcov()[1] == 0.0 ); - VERIFY( u.varcov()[2] == 1.0 ); - typedef __gnu_cxx::normal_mv_distribution<2>::result_type result_type; - VERIFY( u.min()[0] == std::numeric_limits::min() ); - VERIFY( u.max()[0] == std::numeric_limits::max() ); - VERIFY( u.min()[1] == std::numeric_limits::min() ); - VERIFY( u.max()[1] == std::numeric_limits::max() ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/cons/parms.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/cons/parms.cc deleted file mode 100644 index d12722183e1..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/cons/parms.cc +++ /dev/null @@ -1,49 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 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 -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::normal_mv_distribution<2> u({5.0, 4.0}, {4.0, 9.0}); - VERIFY( u.mean()[0] == 5.0 ); - VERIFY( u.mean()[1] == 4.0 ); - VERIFY( u.varcov()[0] == 2.0 ); - VERIFY( u.varcov()[1] == 0.0 ); - VERIFY( u.varcov()[2] == 3.0 ); - typedef __gnu_cxx::normal_mv_distribution<2>::result_type result_type; - VERIFY( u.min()[0] == std::numeric_limits::min() ); - VERIFY( u.max()[0] == std::numeric_limits::max() ); - VERIFY( u.min()[1] == std::numeric_limits::min() ); - VERIFY( u.max()[1] == std::numeric_limits::max() ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/operators/equal.cc deleted file mode 100644 index 99b75817947..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/operators/equal.cc +++ /dev/null @@ -1,42 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-03-16 Paolo Carlini -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 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 -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::normal_mv_distribution<2,double> u({5.0, 4.0}, {2.0, 1.5}), v, w; - - VERIFY( v == w ); - VERIFY( !(u == v) ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/operators/inequal.cc deleted file mode 100644 index 80472a13214..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/operators/inequal.cc +++ /dev/null @@ -1,42 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-03-16 Paolo Carlini -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 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 -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::normal_mv_distribution<2,double> u({3.0, 5.0}, {1.0, 2.0}), v, w; - - VERIFY( u != v ); - VERIFY( !(v != w) ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/operators/serialize.cc deleted file mode 100644 index 3620a9b12bc..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/operators/serialize.cc +++ /dev/null @@ -1,44 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2009-08-14 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 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 -#include - -void -test01() -{ - std::stringstream str; - __gnu_cxx::normal_mv_distribution<2,double> u({1.0, 5.0}, {2.0, 4.0}), v; - std::minstd_rand0 rng; - - u(rng); // advance - str << u; - - str >> v; -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/requirements/explicit_instantiation/1.cc deleted file mode 100644 index 55c4431a972..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/requirements/explicit_instantiation/1.cc +++ /dev/null @@ -1,26 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=c++11" } -// { dg-require-cstdint "" } -// -// Copyright (C) 2012 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 - -template class __gnu_cxx::normal_mv_distribution<2,float>; -template class __gnu_cxx::normal_mv_distribution<2,double>; -template class __gnu_cxx::normal_mv_distribution<2,long double>; diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/requirements/typedefs.cc deleted file mode 100644 index 4a0a14c9020..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/normal_mv_distribution/requirements/typedefs.cc +++ /dev/null @@ -1,34 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 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() -{ - typedef __gnu_cxx::normal_mv_distribution<3,double> test_type; - - typedef test_type::result_type result_type; - typedef test_type::param_type param_type; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/copy.cc deleted file mode 100644 index 8371f4628fa..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/copy.cc +++ /dev/null @@ -1,47 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-02-16 Paolo Carlini -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2010, 2012 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() -{ - typedef uint32_t value_type; - - __gnu_cxx::simd_fast_mersenne_twister_engine e(1); - - const auto f(e); - auto g(f); - g = g; // Suppress unused warning. -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/default.cc deleted file mode 100644 index 5b6489a4028..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/default.cc +++ /dev/null @@ -1,183 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2008, 2009, 2010, 2012 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 -#include -#include - - -template -void run_test(std::initializer_list vals) -{ - typedef typename SFMT::result_type result_type; - SFMT e; - - e.seed(sizeof(result_type) == 4 ? 1234 : 4321); - e.discard(990); - bool success = true; - for (auto i : vals) - { - result_type r = e(); - success &= r == i; - std::cout << r << " vs " << i << std::endl; - } - VERIFY( success ); -} - - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::sfmt19937 e; - - VERIFY( e.min() == 0 ); - VERIFY( e.max() == std::numeric_limits::max() ); - - run_test<__gnu_cxx::sfmt607>({ UINT32_C(1318548553), UINT32_C(1985957974), - UINT32_C(1367744196), UINT32_C(3463392791), UINT32_C(2780736231), - UINT32_C(3894488561), UINT32_C(3157036262), UINT32_C(3491812767), - UINT32_C(1724574180), UINT32_C(3645035493) }); - - run_test<__gnu_cxx::sfmt607_64>({UINT64_C(15510024334182072935), - UINT64_C(5793753331747412752), UINT64_C(16198353238554625740), - UINT64_C(2233208824926016498), UINT64_C(3566091399820823780), - UINT64_C(16608268514591292798), UINT64_C(10684941689666043359), - UINT64_C(12463424292910456802), UINT64_C(5902567440240131366), - UINT64_C(7228030834036501150) }); - - run_test<__gnu_cxx::sfmt1279>({ UINT32_C(66657331), UINT32_C(637106837), - UINT32_C(406927341), UINT32_C(3964420203), UINT32_C(2127134160), - UINT32_C(1327235047), UINT32_C(227339400), UINT32_C(97109542), - UINT32_C(1814799261), UINT32_C(340888197) }); - - run_test<__gnu_cxx::sfmt1279_64>({ UINT64_C(16431921382083697129), - UINT64_C(3107599092104940900), UINT64_C(4055245506102959965), - UINT64_C(16096064917153424198), UINT64_C(14429331498726837109), - UINT64_C(9539664361920633782), UINT64_C(1435296568185387099), - UINT64_C(15922567183295047131), UINT64_C(641988285517426228), - UINT64_C(15936274870984512675) }); - - run_test<__gnu_cxx::sfmt2281>({ UINT32_C(2662391944), UINT32_C(1176696104), - UINT32_C(3587947451), UINT32_C(4098993357), UINT32_C(3140998698), - UINT32_C(870759742), UINT32_C(623529127), UINT32_C(3458807285), - UINT32_C(3341615957), UINT32_C(195614711) }); - - run_test<__gnu_cxx::sfmt2281_64>({ UINT64_C(16747191622237074632), - UINT64_C(15804170396401370381), UINT64_C(3395175278324920203), - UINT64_C(1541877340159274442), UINT64_C(14176322102994316687), - UINT64_C(5130618305074712143), UINT64_C(6769693652413407081), - UINT64_C(17733765687477661079), UINT64_C(5189766940360047353), - UINT64_C(1333654688569723389) }); - - run_test<__gnu_cxx::sfmt4253>({ UINT32_C(90342133), UINT32_C(1083987943), - UINT32_C(1785481425), UINT32_C(1921212667), UINT32_C(3164342992), - UINT32_C(1489324569), UINT32_C(603530523), UINT32_C(952851722), - UINT32_C(2380944844), UINT32_C(3335854133) }); - - run_test<__gnu_cxx::sfmt4253_64>({ UINT64_C(11570915401962514263), - UINT64_C(206693220452528225), UINT64_C(16553299974633247759), - UINT64_C(1069562842508952901), UINT64_C(7203975672387749585), - UINT64_C(7552781925224963166), UINT64_C(16865729458807008705), - UINT64_C(7848963629493506078), UINT64_C(9282397173969292817), - UINT64_C(10738488504584559289) }); - - run_test<__gnu_cxx::sfmt11213>({ UINT32_C(2072997009), UINT32_C(1332330347), - UINT32_C(179681555), UINT32_C(2315290438), UINT32_C(2429393974), - UINT32_C(509881964), UINT32_C(3807607878), UINT32_C(3055319970), - UINT32_C(671840881), UINT32_C(3477325874) }); - - run_test<__gnu_cxx::sfmt11213_64>({ UINT64_C(373867573626408653), - UINT64_C(4732829340233638861), UINT64_C(16174630176505735656), - UINT64_C(10063018133994900869), UINT64_C(17308645173308419196), - UINT64_C(11091353816581371951), UINT64_C(15078420471318089727), - UINT64_C(17965717592743818706), UINT64_C(12301543162252389155), - UINT64_C(1724943167823308511) }); - - run_test<__gnu_cxx::sfmt19937>({ UINT32_C(4002809368), UINT32_C(421169044), - UINT32_C(1112642589), UINT32_C(3076213779), UINT32_C(3387033971), - UINT32_C(2499610950), UINT32_C(3057240914), UINT32_C(1662679783), - UINT32_C(461224431), UINT32_C(1168395933) }); - - run_test<__gnu_cxx::sfmt19937_64>({ UINT64_C(8032857516355555296), - UINT64_C(14023605983059313116), UINT64_C(1032336061815461376), - UINT64_C(9840995337876562612), UINT64_C(9869256223029203587), - UINT64_C(12227975697177267636), UINT64_C(12728115115844186033), - UINT64_C(7752058479783205470), UINT64_C(729733219713393087), - UINT64_C(12954017801239007622) }); - - run_test<__gnu_cxx::sfmt44497>({ UINT32_C(1483092082), UINT32_C(1895679637), - UINT32_C(9122740), UINT32_C(635864575), UINT32_C(320732971), - UINT32_C(4253159584), UINT32_C(30097521), UINT32_C(839233316), - UINT32_C(1431693534), UINT32_C(645981752) }); - - run_test<__gnu_cxx::sfmt44497_64>({ UINT64_C(6246103978016445638), - UINT64_C(4198275826138953222), UINT64_C(12473679170573289212), - UINT64_C(14745709982748360209), UINT64_C(3630790792408208113), - UINT64_C(4195294399578350499), UINT64_C(3742595698794327253), - UINT64_C(17388385867517445933), UINT64_C(4261866397667814669), - UINT64_C(17394085161690598095) }); - - run_test<__gnu_cxx::sfmt86243>({ UINT32_C(3910985535), UINT32_C(100094501), - UINT32_C(3120362616), UINT32_C(1854432382), UINT32_C(314688154), - UINT32_C(522122712), UINT32_C(3026095676), UINT32_C(3681962735), - UINT32_C(1851548627), UINT32_C(2153846465) }); - - run_test<__gnu_cxx::sfmt86243_64>({ UINT64_C(250135615696586029), - UINT64_C(4836277875486422184), UINT64_C(12389320296183057446), - UINT64_C(7983028875884559442), UINT64_C(10079555227308335361), - UINT64_C(14829333386540244214), UINT64_C(12159744972103351172), - UINT64_C(4932579842314286356), UINT64_C(5200375244476537050), - UINT64_C(11795681221121010641) }); - - run_test<__gnu_cxx::sfmt132049>({ UINT32_C(1551023420), UINT32_C(1462317554), - UINT32_C(2882528449), UINT32_C(1136299843), UINT32_C(292840589), - UINT32_C(1307775247), UINT32_C(463274356), UINT32_C(1430357686), - UINT32_C(3907607055), UINT32_C(3462509184) }); - - run_test<__gnu_cxx::sfmt132049_64>({ UINT64_C(649482638765113922), - UINT64_C(14205859353699897918), UINT64_C(14077261854908137257), - UINT64_C(9564785861212212042), UINT64_C(7310747921257808846), - UINT64_C(13759009477111470372), UINT64_C(11942123860149328831), - UINT64_C(12868386070200572127), UINT64_C(18348617059674004332), - UINT64_C(4233208019331956061) }); - - run_test<__gnu_cxx::sfmt216091>({ UINT32_C(4171954654), UINT32_C(2938491210), - UINT32_C(1356393891), UINT32_C(3558249995), UINT32_C(3711769979), - UINT32_C(3434953144), UINT32_C(1601628304), UINT32_C(2187495640), - UINT32_C(1762169715), UINT32_C(2141213778) }); - - run_test<__gnu_cxx::sfmt216091_64>({ UINT64_C(11322404276387828766), - UINT64_C(9653391575000195546), UINT64_C(1767839622905368464), - UINT64_C(1690838241348740821), UINT64_C(817628268513271254), - UINT64_C(15111277786569319196), UINT64_C(15817118810543358764), - UINT64_C(5639001693408668083), UINT64_C(9959854003669400568), - UINT64_C(13675983279642398887) }); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed1.cc b/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed1.cc deleted file mode 100644 index 1926958ea4e..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed1.cc +++ /dev/null @@ -1,43 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2008, 2009, 2010, 2012 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() -{ - unsigned long seed = 2; - __gnu_cxx::simd_fast_mersenne_twister_engine< - uint64_t, 607, 2, - 15, 3, 13, 3, - 0xfdff37ffU, 0xef7f3f7dU, - 0xff777b7dU, 0x7ff7fb2fU, - 0x00000001U, 0x00000000U, - 0x00000000U, 0x5986f054U> x(seed); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed2.cc b/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed2.cc deleted file mode 100644 index 464512c4521..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed2.cc +++ /dev/null @@ -1,43 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2008, 2009, 2010, 2012 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() -{ - double seed = 2.0; - __gnu_cxx::simd_fast_mersenne_twister_engine< - uint64_t, 607, 2, - 15, 3, 13, 3, - 0xfdff37ffU, 0xef7f3f7dU, - 0xff777b7dU, 0x7ff7fb2fU, - 0x00000001U, 0x00000000U, - 0x00000000U, 0x5986f054U> x(seed); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed_seq.cc b/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed_seq.cc deleted file mode 100644 index 4820fa493d9..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed_seq.cc +++ /dev/null @@ -1,43 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-02-01 Paolo Carlini -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2010, 2012 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::seed_seq seed; - __gnu_cxx::simd_fast_mersenne_twister_engine< - uint32_t, 607, 2, - 15, 3, 13, 3, - 0xfdff37ffU, 0xef7f3f7dU, - 0xff777b7dU, 0x7ff7fb2fU, - 0x00000001U, 0x00000000U, - 0x00000000U, 0x5986f054U> x(seed); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/equal.cc deleted file mode 100644 index 80022a68d89..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/equal.cc +++ /dev/null @@ -1,49 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2008, 2009, 2012 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 -// . - -// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::sfmt19937 u, v; - - VERIFY( u == v ); - - u.discard(100); - v.discard(100); - - VERIFY( u == v ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/inequal.cc deleted file mode 100644 index 15aaf127814..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/inequal.cc +++ /dev/null @@ -1,52 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-03-16 Paolo Carlini -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2010, 2012 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 -// . - -// 26.5.3.2 Class template mersenne_twister_engine [rand.eng.mers] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::sfmt19937 u, v; - - VERIFY( !(u != v) ); - - u.discard(100); - v.discard(100); - - VERIFY( !(u != v) ); - - v.discard(1); - - VERIFY( u != v ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/serialize.cc deleted file mode 100644 index ddc62b5605e..00000000000 --- a/libstdc++-v3/testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/serialize.cc +++ /dev/null @@ -1,66 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2008, 2009, 2010, 2011, 2012 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 -// . - -// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - -#include -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::stringstream str; - __gnu_cxx::sfmt19937 u, v; - - u(); // advance - str << u; - - VERIFY( !(u == v) ); - - str >> v; - VERIFY( u == v ); - for (unsigned i = 0; i < 1000; ++i) - VERIFY( u() == v() ); - - str.clear(); - str << v; - - u(); - u(); - u(); - - str >> u; - VERIFY( u == v ); - for (unsigned i = 0; i < 1000; ++i) - VERIFY( u() == v() ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in index e919747e734..b33cdf15bc9 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -146,6 +146,7 @@ FGREP = @FGREP@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ +HWCAP_FLAGS = @HWCAP_FLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -293,7 +294,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir) # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. CONFIG_CXXFLAGS = \ - $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ + $(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@ WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once diff --git a/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc new file mode 100644 index 00000000000..3aa2d851e98 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc @@ -0,0 +1,43 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-09-04 Ulrich Drepper +// +// Copyright (C) 2012 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 +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::beta_distribution<> u; + VERIFY( u.alpha() == 1.0 ); + VERIFY( u.beta() == 1.0 ); + VERIFY( u.min() == 0.0 ); + VERIFY( u.max() == 1.0 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/parms.cc b/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/parms.cc new file mode 100644 index 00000000000..9d6c0b18da7 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/parms.cc @@ -0,0 +1,43 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-09-04 Ulrich Drepper +// +// Copyright (C) 2012 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 +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::beta_distribution<> u(1.5, 3.0); + VERIFY( u.alpha() == 1.5 ); + VERIFY( u.beta() == 3.0 ); + VERIFY( u.min() == 0.0 ); + VERIFY( u.max() == 1.0 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/beta_distribution/operators/equal.cc b/libstdc++-v3/testsuite/ext/random/beta_distribution/operators/equal.cc new file mode 100644 index 00000000000..a31a6545d53 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/beta_distribution/operators/equal.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-03-16 Paolo Carlini +// 2012-09-04 Ulrich Drepper +// +// Copyright (C) 2012 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 +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::beta_distribution u(1.5, 3.0), v, w; + + VERIFY( v == w ); + VERIFY( !(u == v) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/beta_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/ext/random/beta_distribution/operators/inequal.cc new file mode 100644 index 00000000000..d7eda3935bf --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/beta_distribution/operators/inequal.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-03-16 Paolo Carlini +// 2012-09-04 Ulrich Drepper +// +// Copyright (C) 2012 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 +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::beta_distribution u(1.5, 3.0), v, w; + + VERIFY( u != v ); + VERIFY( !(v != w) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/beta_distribution/operators/serialize.cc b/libstdc++-v3/testsuite/ext/random/beta_distribution/operators/serialize.cc new file mode 100644 index 00000000000..dd2fed8d590 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/beta_distribution/operators/serialize.cc @@ -0,0 +1,44 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2009-08-14 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-09-04 Ulrich Drepper +// +// Copyright (C) 2012 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 +#include + +void +test01() +{ + std::stringstream str; + __gnu_cxx::beta_distribution u(1.5, 3.0), v; + std::minstd_rand0 rng; + + u(rng); // advance + str << u; + + str >> v; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/beta_distribution/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/ext/random/beta_distribution/requirements/explicit_instantiation/1.cc new file mode 100644 index 00000000000..a572b1478ae --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/beta_distribution/requirements/explicit_instantiation/1.cc @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-std=c++11" } +// { dg-require-cstdint "" } +// +// Copyright (C) 2012 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 + +template class __gnu_cxx::beta_distribution; +template class __gnu_cxx::beta_distribution; +template class __gnu_cxx::beta_distribution; diff --git a/libstdc++-v3/testsuite/ext/random/beta_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/ext/random/beta_distribution/requirements/typedefs.cc new file mode 100644 index 00000000000..33b18ae535c --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/beta_distribution/requirements/typedefs.cc @@ -0,0 +1,34 @@ +// { dg-do compile } +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-09-04 Ulrich Drepper +// +// Copyright (C) 2012 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() +{ + typedef __gnu_cxx::beta_distribution test_type; + + typedef test_type::result_type result_type; + typedef test_type::param_type param_type; +} diff --git a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc new file mode 100644 index 00000000000..a51fde40f03 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc @@ -0,0 +1,49 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-09-04 Ulrich Drepper +// +// Copyright (C) 2012 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 +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::normal_mv_distribution<2> u; + VERIFY( u.mean()[0] == 0.0 ); + VERIFY( u.mean()[1] == 0.0 ); + VERIFY( u.varcov()[0] == 1.0 ); + VERIFY( u.varcov()[1] == 0.0 ); + VERIFY( u.varcov()[2] == 1.0 ); + typedef __gnu_cxx::normal_mv_distribution<2>::result_type result_type; + VERIFY( u.min()[0] == std::numeric_limits::min() ); + VERIFY( u.max()[0] == std::numeric_limits::max() ); + VERIFY( u.min()[1] == std::numeric_limits::min() ); + VERIFY( u.max()[1] == std::numeric_limits::max() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/parms.cc b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/parms.cc new file mode 100644 index 00000000000..d12722183e1 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/parms.cc @@ -0,0 +1,49 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-09-04 Ulrich Drepper +// +// Copyright (C) 2012 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 +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::normal_mv_distribution<2> u({5.0, 4.0}, {4.0, 9.0}); + VERIFY( u.mean()[0] == 5.0 ); + VERIFY( u.mean()[1] == 4.0 ); + VERIFY( u.varcov()[0] == 2.0 ); + VERIFY( u.varcov()[1] == 0.0 ); + VERIFY( u.varcov()[2] == 3.0 ); + typedef __gnu_cxx::normal_mv_distribution<2>::result_type result_type; + VERIFY( u.min()[0] == std::numeric_limits::min() ); + VERIFY( u.max()[0] == std::numeric_limits::max() ); + VERIFY( u.min()[1] == std::numeric_limits::min() ); + VERIFY( u.max()[1] == std::numeric_limits::max() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/operators/equal.cc b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/operators/equal.cc new file mode 100644 index 00000000000..99b75817947 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/operators/equal.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-03-16 Paolo Carlini +// 2012-09-04 Ulrich Drepper +// +// Copyright (C) 2012 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 +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::normal_mv_distribution<2,double> u({5.0, 4.0}, {2.0, 1.5}), v, w; + + VERIFY( v == w ); + VERIFY( !(u == v) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/operators/inequal.cc new file mode 100644 index 00000000000..80472a13214 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/operators/inequal.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-03-16 Paolo Carlini +// 2012-09-04 Ulrich Drepper +// +// Copyright (C) 2012 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 +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::normal_mv_distribution<2,double> u({3.0, 5.0}, {1.0, 2.0}), v, w; + + VERIFY( u != v ); + VERIFY( !(v != w) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/operators/serialize.cc b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/operators/serialize.cc new file mode 100644 index 00000000000..3620a9b12bc --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/operators/serialize.cc @@ -0,0 +1,44 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2009-08-14 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-09-04 Ulrich Drepper +// +// Copyright (C) 2012 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 +#include + +void +test01() +{ + std::stringstream str; + __gnu_cxx::normal_mv_distribution<2,double> u({1.0, 5.0}, {2.0, 4.0}), v; + std::minstd_rand0 rng; + + u(rng); // advance + str << u; + + str >> v; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/requirements/explicit_instantiation/1.cc new file mode 100644 index 00000000000..55c4431a972 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/requirements/explicit_instantiation/1.cc @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-std=c++11" } +// { dg-require-cstdint "" } +// +// Copyright (C) 2012 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 + +template class __gnu_cxx::normal_mv_distribution<2,float>; +template class __gnu_cxx::normal_mv_distribution<2,double>; +template class __gnu_cxx::normal_mv_distribution<2,long double>; diff --git a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/requirements/typedefs.cc new file mode 100644 index 00000000000..4a0a14c9020 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/requirements/typedefs.cc @@ -0,0 +1,34 @@ +// { dg-do compile } +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-09-04 Ulrich Drepper +// +// Copyright (C) 2012 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() +{ + typedef __gnu_cxx::normal_mv_distribution<3,double> test_type; + + typedef test_type::result_type result_type; + typedef test_type::param_type param_type; +} diff --git a/libstdc++-v3/testsuite/ext/random/rice_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/rice_distribution/cons/default.cc new file mode 100644 index 00000000000..3a49140fcb9 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/rice_distribution/cons/default.cc @@ -0,0 +1,47 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2012-01-28 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2012 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 +// . + +// 26.4.8.3.* Class template rice_distribution [rand.dist.ext.rice] +// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist] + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::rice_distribution<> u; + VERIFY( u.nu() == 0.0 ); + VERIFY( u.sigma() == 1.0 ); + VERIFY( u.min() == 0.0 ); + typedef __gnu_cxx::rice_distribution<>::result_type result_type; + VERIFY( u.max() == std::numeric_limits::max() ); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/rice_distribution/cons/parms.cc b/libstdc++-v3/testsuite/ext/random/rice_distribution/cons/parms.cc new file mode 100644 index 00000000000..fa79ef521ae --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/rice_distribution/cons/parms.cc @@ -0,0 +1,47 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2012-01-28 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2012 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 +// . + +// 26.4.8.3.* Class template rice_distribution [rand.dist.ext.rice] +// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist] + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::rice_distribution<> u(1.5, 3.0); + VERIFY( u.nu() == 1.5 ); + VERIFY( u.sigma() == 3.0 ); + VERIFY( u.min() == 0.0 ); + typedef __gnu_cxx::rice_distribution<>::result_type result_type; + VERIFY( u.max() == std::numeric_limits::max() ); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/rice_distribution/operators/equal.cc b/libstdc++-v3/testsuite/ext/random/rice_distribution/operators/equal.cc new file mode 100644 index 00000000000..2539d6ed42b --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/rice_distribution/operators/equal.cc @@ -0,0 +1,44 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2012-01-28 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2012 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 +// . + +// 26.5.8.4.5 Class template rice_distribution [rand.dist.ext.rice] + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::rice_distribution u(2.0, 3.0), v, w; + + VERIFY( v == w ); + VERIFY( !(u == v) ); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/rice_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/ext/random/rice_distribution/operators/inequal.cc new file mode 100644 index 00000000000..a3f15124af9 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/rice_distribution/operators/inequal.cc @@ -0,0 +1,44 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2012-01-28 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2012 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 +// . + +// 26.5.8.4.5 Class template rice_distribution [rand.dist.ext.rice] + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::rice_distribution u(2.0, 3.0), v, w; + + VERIFY( u != v ); + VERIFY( !(v != w) ); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/rice_distribution/operators/serialize.cc b/libstdc++-v3/testsuite/ext/random/rice_distribution/operators/serialize.cc new file mode 100644 index 00000000000..9d39c3098e5 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/rice_distribution/operators/serialize.cc @@ -0,0 +1,51 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2012-01-28 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2012 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 +// . + +// 26.4.8.3.* Class template rice_distribution [rand.dist.ext.rice] +// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist] + +#include +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::stringstream str; + __gnu_cxx::rice_distribution u(1.5, 3.0), v; + std::minstd_rand0 rng; + + u(rng); // advance + str << u; + + str >> v; + VERIFY( u == v ); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/rice_distribution/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/ext/random/rice_distribution/requirements/explicit_instantiation/1.cc new file mode 100644 index 00000000000..2026c9ec51d --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/rice_distribution/requirements/explicit_instantiation/1.cc @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-std=c++11" } +// { dg-require-cstdint "" } +// +// Copyright (C) 2012 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 + +template class __gnu_cxx::rice_distribution; +template class __gnu_cxx::rice_distribution; +template class __gnu_cxx::rice_distribution; diff --git a/libstdc++-v3/testsuite/ext/random/rice_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/ext/random/rice_distribution/requirements/typedefs.cc new file mode 100644 index 00000000000..b524a7b5aa3 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/rice_distribution/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-do compile } +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2012-01-28 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2012 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 +// . + +// 26.4.8.3.* Class template rice_distribution [rand.dist.ext.rice] +// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist] + +#include + +void +test01() +{ + typedef __gnu_cxx::rice_distribution test_type; + + typedef test_type::result_type result_type; + typedef test_type::param_type param_type; +} diff --git a/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/copy.cc b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/copy.cc new file mode 100644 index 00000000000..8371f4628fa --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/copy.cc @@ -0,0 +1,47 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-02-16 Paolo Carlini +// 2012-08-28 Ulrich Drepper , adapted for SFMT +// +// Copyright (C) 2010, 2012 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() +{ + typedef uint32_t value_type; + + __gnu_cxx::simd_fast_mersenne_twister_engine e(1); + + const auto f(e); + auto g(f); + g = g; // Suppress unused warning. +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/default.cc b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/default.cc new file mode 100644 index 00000000000..5b6489a4028 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/default.cc @@ -0,0 +1,183 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-08-28 Ulrich Drepper , adapted for SFMT +// +// Copyright (C) 2008, 2009, 2010, 2012 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 +#include +#include + + +template +void run_test(std::initializer_list vals) +{ + typedef typename SFMT::result_type result_type; + SFMT e; + + e.seed(sizeof(result_type) == 4 ? 1234 : 4321); + e.discard(990); + bool success = true; + for (auto i : vals) + { + result_type r = e(); + success &= r == i; + std::cout << r << " vs " << i << std::endl; + } + VERIFY( success ); +} + + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::sfmt19937 e; + + VERIFY( e.min() == 0 ); + VERIFY( e.max() == std::numeric_limits::max() ); + + run_test<__gnu_cxx::sfmt607>({ UINT32_C(1318548553), UINT32_C(1985957974), + UINT32_C(1367744196), UINT32_C(3463392791), UINT32_C(2780736231), + UINT32_C(3894488561), UINT32_C(3157036262), UINT32_C(3491812767), + UINT32_C(1724574180), UINT32_C(3645035493) }); + + run_test<__gnu_cxx::sfmt607_64>({UINT64_C(15510024334182072935), + UINT64_C(5793753331747412752), UINT64_C(16198353238554625740), + UINT64_C(2233208824926016498), UINT64_C(3566091399820823780), + UINT64_C(16608268514591292798), UINT64_C(10684941689666043359), + UINT64_C(12463424292910456802), UINT64_C(5902567440240131366), + UINT64_C(7228030834036501150) }); + + run_test<__gnu_cxx::sfmt1279>({ UINT32_C(66657331), UINT32_C(637106837), + UINT32_C(406927341), UINT32_C(3964420203), UINT32_C(2127134160), + UINT32_C(1327235047), UINT32_C(227339400), UINT32_C(97109542), + UINT32_C(1814799261), UINT32_C(340888197) }); + + run_test<__gnu_cxx::sfmt1279_64>({ UINT64_C(16431921382083697129), + UINT64_C(3107599092104940900), UINT64_C(4055245506102959965), + UINT64_C(16096064917153424198), UINT64_C(14429331498726837109), + UINT64_C(9539664361920633782), UINT64_C(1435296568185387099), + UINT64_C(15922567183295047131), UINT64_C(641988285517426228), + UINT64_C(15936274870984512675) }); + + run_test<__gnu_cxx::sfmt2281>({ UINT32_C(2662391944), UINT32_C(1176696104), + UINT32_C(3587947451), UINT32_C(4098993357), UINT32_C(3140998698), + UINT32_C(870759742), UINT32_C(623529127), UINT32_C(3458807285), + UINT32_C(3341615957), UINT32_C(195614711) }); + + run_test<__gnu_cxx::sfmt2281_64>({ UINT64_C(16747191622237074632), + UINT64_C(15804170396401370381), UINT64_C(3395175278324920203), + UINT64_C(1541877340159274442), UINT64_C(14176322102994316687), + UINT64_C(5130618305074712143), UINT64_C(6769693652413407081), + UINT64_C(17733765687477661079), UINT64_C(5189766940360047353), + UINT64_C(1333654688569723389) }); + + run_test<__gnu_cxx::sfmt4253>({ UINT32_C(90342133), UINT32_C(1083987943), + UINT32_C(1785481425), UINT32_C(1921212667), UINT32_C(3164342992), + UINT32_C(1489324569), UINT32_C(603530523), UINT32_C(952851722), + UINT32_C(2380944844), UINT32_C(3335854133) }); + + run_test<__gnu_cxx::sfmt4253_64>({ UINT64_C(11570915401962514263), + UINT64_C(206693220452528225), UINT64_C(16553299974633247759), + UINT64_C(1069562842508952901), UINT64_C(7203975672387749585), + UINT64_C(7552781925224963166), UINT64_C(16865729458807008705), + UINT64_C(7848963629493506078), UINT64_C(9282397173969292817), + UINT64_C(10738488504584559289) }); + + run_test<__gnu_cxx::sfmt11213>({ UINT32_C(2072997009), UINT32_C(1332330347), + UINT32_C(179681555), UINT32_C(2315290438), UINT32_C(2429393974), + UINT32_C(509881964), UINT32_C(3807607878), UINT32_C(3055319970), + UINT32_C(671840881), UINT32_C(3477325874) }); + + run_test<__gnu_cxx::sfmt11213_64>({ UINT64_C(373867573626408653), + UINT64_C(4732829340233638861), UINT64_C(16174630176505735656), + UINT64_C(10063018133994900869), UINT64_C(17308645173308419196), + UINT64_C(11091353816581371951), UINT64_C(15078420471318089727), + UINT64_C(17965717592743818706), UINT64_C(12301543162252389155), + UINT64_C(1724943167823308511) }); + + run_test<__gnu_cxx::sfmt19937>({ UINT32_C(4002809368), UINT32_C(421169044), + UINT32_C(1112642589), UINT32_C(3076213779), UINT32_C(3387033971), + UINT32_C(2499610950), UINT32_C(3057240914), UINT32_C(1662679783), + UINT32_C(461224431), UINT32_C(1168395933) }); + + run_test<__gnu_cxx::sfmt19937_64>({ UINT64_C(8032857516355555296), + UINT64_C(14023605983059313116), UINT64_C(1032336061815461376), + UINT64_C(9840995337876562612), UINT64_C(9869256223029203587), + UINT64_C(12227975697177267636), UINT64_C(12728115115844186033), + UINT64_C(7752058479783205470), UINT64_C(729733219713393087), + UINT64_C(12954017801239007622) }); + + run_test<__gnu_cxx::sfmt44497>({ UINT32_C(1483092082), UINT32_C(1895679637), + UINT32_C(9122740), UINT32_C(635864575), UINT32_C(320732971), + UINT32_C(4253159584), UINT32_C(30097521), UINT32_C(839233316), + UINT32_C(1431693534), UINT32_C(645981752) }); + + run_test<__gnu_cxx::sfmt44497_64>({ UINT64_C(6246103978016445638), + UINT64_C(4198275826138953222), UINT64_C(12473679170573289212), + UINT64_C(14745709982748360209), UINT64_C(3630790792408208113), + UINT64_C(4195294399578350499), UINT64_C(3742595698794327253), + UINT64_C(17388385867517445933), UINT64_C(4261866397667814669), + UINT64_C(17394085161690598095) }); + + run_test<__gnu_cxx::sfmt86243>({ UINT32_C(3910985535), UINT32_C(100094501), + UINT32_C(3120362616), UINT32_C(1854432382), UINT32_C(314688154), + UINT32_C(522122712), UINT32_C(3026095676), UINT32_C(3681962735), + UINT32_C(1851548627), UINT32_C(2153846465) }); + + run_test<__gnu_cxx::sfmt86243_64>({ UINT64_C(250135615696586029), + UINT64_C(4836277875486422184), UINT64_C(12389320296183057446), + UINT64_C(7983028875884559442), UINT64_C(10079555227308335361), + UINT64_C(14829333386540244214), UINT64_C(12159744972103351172), + UINT64_C(4932579842314286356), UINT64_C(5200375244476537050), + UINT64_C(11795681221121010641) }); + + run_test<__gnu_cxx::sfmt132049>({ UINT32_C(1551023420), UINT32_C(1462317554), + UINT32_C(2882528449), UINT32_C(1136299843), UINT32_C(292840589), + UINT32_C(1307775247), UINT32_C(463274356), UINT32_C(1430357686), + UINT32_C(3907607055), UINT32_C(3462509184) }); + + run_test<__gnu_cxx::sfmt132049_64>({ UINT64_C(649482638765113922), + UINT64_C(14205859353699897918), UINT64_C(14077261854908137257), + UINT64_C(9564785861212212042), UINT64_C(7310747921257808846), + UINT64_C(13759009477111470372), UINT64_C(11942123860149328831), + UINT64_C(12868386070200572127), UINT64_C(18348617059674004332), + UINT64_C(4233208019331956061) }); + + run_test<__gnu_cxx::sfmt216091>({ UINT32_C(4171954654), UINT32_C(2938491210), + UINT32_C(1356393891), UINT32_C(3558249995), UINT32_C(3711769979), + UINT32_C(3434953144), UINT32_C(1601628304), UINT32_C(2187495640), + UINT32_C(1762169715), UINT32_C(2141213778) }); + + run_test<__gnu_cxx::sfmt216091_64>({ UINT64_C(11322404276387828766), + UINT64_C(9653391575000195546), UINT64_C(1767839622905368464), + UINT64_C(1690838241348740821), UINT64_C(817628268513271254), + UINT64_C(15111277786569319196), UINT64_C(15817118810543358764), + UINT64_C(5639001693408668083), UINT64_C(9959854003669400568), + UINT64_C(13675983279642398887) }); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/seed1.cc b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/seed1.cc new file mode 100644 index 00000000000..1926958ea4e --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/seed1.cc @@ -0,0 +1,43 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-08-28 Ulrich Drepper , adapted for SFMT +// +// Copyright (C) 2008, 2009, 2010, 2012 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() +{ + unsigned long seed = 2; + __gnu_cxx::simd_fast_mersenne_twister_engine< + uint64_t, 607, 2, + 15, 3, 13, 3, + 0xfdff37ffU, 0xef7f3f7dU, + 0xff777b7dU, 0x7ff7fb2fU, + 0x00000001U, 0x00000000U, + 0x00000000U, 0x5986f054U> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/seed2.cc b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/seed2.cc new file mode 100644 index 00000000000..464512c4521 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/seed2.cc @@ -0,0 +1,43 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-08-28 Ulrich Drepper , adapted for SFMT +// +// Copyright (C) 2008, 2009, 2010, 2012 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() +{ + double seed = 2.0; + __gnu_cxx::simd_fast_mersenne_twister_engine< + uint64_t, 607, 2, + 15, 3, 13, 3, + 0xfdff37ffU, 0xef7f3f7dU, + 0xff777b7dU, 0x7ff7fb2fU, + 0x00000001U, 0x00000000U, + 0x00000000U, 0x5986f054U> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/seed_seq.cc b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/seed_seq.cc new file mode 100644 index 00000000000..4820fa493d9 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/seed_seq.cc @@ -0,0 +1,43 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-02-01 Paolo Carlini +// 2012-08-28 Ulrich Drepper , adapted for SFMT +// +// Copyright (C) 2010, 2012 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::seed_seq seed; + __gnu_cxx::simd_fast_mersenne_twister_engine< + uint32_t, 607, 2, + 15, 3, 13, 3, + 0xfdff37ffU, 0xef7f3f7dU, + 0xff777b7dU, 0x7ff7fb2fU, + 0x00000001U, 0x00000000U, + 0x00000000U, 0x5986f054U> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/operators/equal.cc b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/operators/equal.cc new file mode 100644 index 00000000000..80022a68d89 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/operators/equal.cc @@ -0,0 +1,49 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-08-28 Ulrich Drepper , adapted for SFMT +// +// Copyright (C) 2008, 2009, 2012 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 +// . + +// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers] +// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::sfmt19937 u, v; + + VERIFY( u == v ); + + u.discard(100); + v.discard(100); + + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/operators/inequal.cc b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/operators/inequal.cc new file mode 100644 index 00000000000..15aaf127814 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/operators/inequal.cc @@ -0,0 +1,52 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-03-16 Paolo Carlini +// 2012-08-28 Ulrich Drepper , adapted for SFMT +// +// Copyright (C) 2010, 2012 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 +// . + +// 26.5.3.2 Class template mersenne_twister_engine [rand.eng.mers] + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + __gnu_cxx::sfmt19937 u, v; + + VERIFY( !(u != v) ); + + u.discard(100); + v.discard(100); + + VERIFY( !(u != v) ); + + v.discard(1); + + VERIFY( u != v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/operators/serialize.cc b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/operators/serialize.cc new file mode 100644 index 00000000000..ddc62b5605e --- /dev/null +++ b/libstdc++-v3/testsuite/ext/random/simd_fast_mersenne_twister_engine/operators/serialize.cc @@ -0,0 +1,66 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> +// 2012-08-28 Ulrich Drepper , adapted for SFMT +// +// Copyright (C) 2008, 2009, 2010, 2011, 2012 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 +// . + +// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers] +// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] + +#include +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::stringstream str; + __gnu_cxx::sfmt19937 u, v; + + u(); // advance + str << u; + + VERIFY( !(u == v) ); + + str >> v; + VERIFY( u == v ); + for (unsigned i = 0; i < 1000; ++i) + VERIFY( u() == v() ); + + str.clear(); + str << v; + + u(); + u(); + u(); + + str >> u; + VERIFY( u == v ); + for (unsigned i = 0; i < 1000; ++i) + VERIFY( u() == v() ); +} + +int main() +{ + test01(); + return 0; +} -- cgit v1.2.1