+2018-07-04 Jonathan Wakely <jwakely@redhat.com>
+
+ * testsuite/25_algorithms/make_heap/complexity.cc: Require effective
+ target for std::random_device.
+ * testsuite/26_numerics/random/random_device/cons/default.cc:
+ Likewise.
+ * testsuite/experimental/algorithm/sample-2.cc: Likewise.
+ * testsuite/experimental/algorithm/shuffle.cc: Likewise.
+ * testsuite/experimental/random/randint.cc: Likewise.
+ * testsuite/lib/libstdc++.exp
+ (check_effective_target_random_device): New proc.
+
2018-07-04 Jonathan Wakely <jwakely@redhat.com>
Jakub Jelinek <jakub@redhat.com>
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++11 } }
+// { dg-require-effective-target random_device }
#include <random>
#include <vector>
// { dg-do run { target c++11 } }
+// { dg-require-effective-target random_device }
// { dg-require-cstdint "" }
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++14 } }
+// { dg-require-effective-target random_device }
// { dg-require-effective-target tls_runtime }
// { dg-add-options tls }
// { dg-do run { target c++14 } }
+// { dg-require-effective-target random_device }
// { dg-require-effective-target tls_runtime }
// { dg-add-options tls }
// { dg-do run { target c++14 } }
+// { dg-require-effective-target random_device }
// { dg-require-effective-target tls_runtime }
// { dg-add-options tls }
return 0
}
+# Return 1 if std::random_device should be usable using the current flags, 0 otherwise.
+proc check_effective_target_random_device { } {
+ global cxxflags
+
+ # Set up and preprocess a C++ test program that depends
+ # on std::random_device being usable.
+ set src random_device[pid].cc
+
+ set f [open $src "w"]
+ puts $f "#include <bits/c++config.h>"
+ puts $f "#if ! _GLIBCXX_USE_RANDOM_TR1"
+ puts $f "# error No working std::random_device available"
+ puts $f "#endif"
+ close $f
+
+ set lines [v3_target_compile $src /dev/null preprocess ""]
+ file delete $src
+
+ if [string match "" $lines] {
+ # No error message, preprocessing succeeded.
+ verbose "check_v3_random_device: `1'" 2
+ return 1
+ }
+
+ verbose "check_v3_random_device: `0'" 2
+ return 0
+}
+
set additional_prunes ""
if { [info exists env(GCC_RUNTEST_PARALLELIZE_DIR)] \