aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite
diff options
context:
space:
mode:
authorChris Fairles <cfairles@gcc.gnu.org>2009-01-15 14:01:04 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2009-01-15 14:01:04 +0000
commit959d14e166813ae53bfc2e0bb5c2953bce764702 (patch)
treea3d0a02869ac2d4272d8edb67dd33bc6a37b3633 /libstdc++-v3/testsuite
parent52535a64bf7645528bea628863a96a1588de0ac7 (diff)
downloadgcc-959d14e166813ae53bfc2e0bb5c2953bce764702.zip
gcc-959d14e166813ae53bfc2e0bb5c2953bce764702.tar.gz
gcc-959d14e166813ae53bfc2e0bb5c2953bce764702.tar.bz2
acinclude.m4 ([GLIBCXX_ENABLE_CLOCK_GETTIME], [...]): Remove.
2009-01-15 Chris Fairles <cfairles@gcc.gnu.org> Paolo Carlini <paolo.carlini@oracle.com> * acinclude.m4 ([GLIBCXX_ENABLE_CLOCK_GETTIME], [GLIBCXX_CHECK_NANOSLEEP]): Remove. ([GLIBCXX_ENABLE_LIBSTDCXX_TIME]): Add. * configure.ac: Adjust. * doc/xml/manual/configure.xml: Update. * testsuite/lib/libstdc++.exp (check_v3_target_sched_yield): Add. * testsuite/lib/dg-options.exp (dg-require-sched-yield): Add. * testsuite/30_threads/thread/this_thread/2.cc: Use the latter. * configure: Regenerate. * config.h.in: Likewise. * src/thread.cc (thread::thread(), thread::~thread, thread::get_id, thread::joinable, thread::swap, this_thread::get_id, this_thread::yield): Define inline... * include/std/thread: ... here. * config/abi/pre/gnu.ver: Adjust. Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com> From-SVN: r143397
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/this_thread/2.cc3
-rw-r--r--libstdc++-v3/testsuite/lib/dg-options.exp12
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp60
3 files changed, 72 insertions, 3 deletions
diff --git a/libstdc++-v3/testsuite/30_threads/thread/this_thread/2.cc b/libstdc++-v3/testsuite/30_threads/thread/this_thread/2.cc
index cf60c2c..a632a45 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/this_thread/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/this_thread/2.cc
@@ -4,8 +4,9 @@
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
+// { dg-require-sched-yield "" }
-// Copyright (C) 2008 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp
index 7807225..8270376 100644
--- a/libstdc++-v3/testsuite/lib/dg-options.exp
+++ b/libstdc++-v3/testsuite/lib/dg-options.exp
@@ -1,6 +1,7 @@
# Handlers for additional dg-xxx keywords in tests.
-# Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -125,6 +126,15 @@ proc dg-require-nanosleep { args } {
return
}
+proc dg-require-sched-yield { args } {
+ if { ![ check_v3_target_sched_yield ] } {
+ upvar dg-do-what dg-do-what
+ set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+ return
+ }
+ return
+}
+
proc dg-require-string-conversions { args } {
if { ![ check_v3_target_string_conversions ] } {
upvar dg-do-what dg-do-what
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 3b2e18b..bd01b25 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -1,6 +1,6 @@
# libstdc++ "tool init file" for DejaGNU
-# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -1261,6 +1261,64 @@ proc check_v3_target_nanosleep { } {
return $et_nanosleep
}
+proc check_v3_target_sched_yield { } {
+ global cxxflags
+ global DEFAULT_CXXFLAGS
+ global et_sched_yield
+
+ global tool
+
+ if { ![info exists et_sched_yield_target_name] } {
+ set et_sched_yield_target_name ""
+ }
+
+ # If the target has changed since we set the cached value, clear it.
+ set current_target [current_target_name]
+ if { $current_target != $et_sched_yield_target_name } {
+ verbose "check_v3_target_sched_yield: `$et_sched_yield_target_name'" 2
+ set et_sched_yield_target_name $current_target
+ if [info exists et_sched_yield] {
+ verbose "check_v3_target_sched_yield: removing cached result" 2
+ unset et_sched_yield
+ }
+ }
+
+ if [info exists et_sched_yield] {
+ verbose "check_v3_target_sched_yield: using cached result" 2
+ } else {
+ set et_sched_yield 0
+
+ # Set up and compile a C++0x test program that depends
+ # on the sched_yield facility to be available.
+ set src sched_yield[pid].cc
+ set exe sched_yield[pid].exe
+
+ set f [open $src "w"]
+ puts $f "#include <bits/c++config.h>"
+ puts $f "int main()"
+ puts $f "#ifdef _GLIBCXX_USE_SCHED_YIELD"
+ puts $f "{ return 0; }"
+ puts $f "#endif"
+ close $f
+
+ set cxxflags_saved $cxxflags
+ set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
+
+ set lines [v3_target_compile $src $exe executable ""]
+ set cxxflags $cxxflags_saved
+ file delete $src
+
+ if [string match "" $lines] {
+ # No error message, compilation succeeded.
+ set et_sched_yield 1
+ } else {
+ verbose "check_v3_target_sched_yield: compilation failed" 2
+ }
+ }
+ verbose "check_v3_target_sched_yield: $et_sched_yield" 2
+ return $et_sched_yield
+}
+
proc check_v3_target_string_conversions { } {
global cxxflags
global DEFAULT_CXXFLAGS