aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex
diff options
context:
space:
mode:
authorJing Yu <jingyu@google.com>2010-07-22 14:03:48 -0700
committerJing Yu <jingyu@google.com>2010-07-22 14:03:48 -0700
commitb094d6c4bf572654a031ecc4afe675154c886dc5 (patch)
tree89394c56b05e13a5413ee60237d65b0214fd98e2 /gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex
parentdc34721ac3bf7e3c406fba8cfe9d139393345ec5 (diff)
downloadtoolchain_gcc-b094d6c4bf572654a031ecc4afe675154c886dc5.tar.gz
toolchain_gcc-b094d6c4bf572654a031ecc4afe675154c886dc5.tar.bz2
toolchain_gcc-b094d6c4bf572654a031ecc4afe675154c886dc5.zip
commit gcc-4.4.3 which is used to build gcc-4.4.3 Android toolchain in master.
The source is based on fsf gcc-4.4.3 and contains local patches which are recorded in gcc-4.4.3/README.google. Change-Id: Id8c6d6927df274ae9749196a1cc24dbd9abc9887
Diffstat (limited to 'gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex')
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc49
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc36
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc35
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc51
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc63
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc63
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc51
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc33
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc33
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc52
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc64
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc53
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc54
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc70
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc52
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc63
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc52
17 files changed, 874 insertions, 0 deletions
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc
new file mode 100644
index 000000000..cc257956c
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc
@@ -0,0 +1,49 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+
+ try
+ {
+ mutex_type m1;
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc
new file mode 100644
index 000000000..2e092bedd
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc
@@ -0,0 +1,36 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+
+void test01()
+{
+ // assign
+ typedef std::recursive_timed_mutex mutex_type;
+ mutex_type m1;
+ mutex_type m2;
+ m1 = m2;
+}
+
+// { dg-error "used here" "" { target *-*-* } 32 }
+// { dg-error "deleted function" "" { target *-*-* } 298 }
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc
new file mode 100644
index 000000000..9d10a7dac
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc
@@ -0,0 +1,35 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+
+void test01()
+{
+ // assign
+ typedef std::recursive_timed_mutex mutex_type;
+ mutex_type m1;
+ mutex_type m2(m1);
+}
+
+// { dg-error "used here" "" { target *-*-* } 31 }
+// { dg-error "deleted function" "" { target *-*-* } 297 }
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc
new file mode 100644
index 000000000..8442fbfa5
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc
@@ -0,0 +1,51 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+
+ try
+ {
+ mutex_type m;
+ m.lock();
+ }
+ catch (const std::system_error& e)
+ {
+ // Destroying locked mutex raises system error, or undefined.
+ // POSIX == may fail with EBUSY.
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc
new file mode 100644
index 000000000..2fc97e019
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc
@@ -0,0 +1,63 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+
+ try
+ {
+ mutex_type m;
+ m.lock();
+
+ // Lock already locked mutex.
+ try
+ {
+ // XXX Will block.
+ // m.lock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc
new file mode 100644
index 000000000..c725b63b6
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc
@@ -0,0 +1,63 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+
+ try
+ {
+ mutex_type m;
+ m.lock();
+
+ // Lock already locked mutex.
+ try
+ {
+ // XXX Will not block.
+ // m.lock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc
new file mode 100644
index 000000000..96e64f34c
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc
@@ -0,0 +1,51 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+
+ try
+ {
+ mutex_type m;
+ mutex_type::native_handle_type n = m.native_handle();
+ (void)n;
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc
new file mode 100644
index 000000000..d2fd9f6e0
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc
@@ -0,0 +1,33 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <mutex>
+#include <thread/all.h>
+
+int main()
+{
+ typedef std::recursive_timed_mutex test_type;
+ __gnu_test::compare_type_to_native_type<test_type>();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc
new file mode 100644
index 000000000..46a27d6da
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc
@@ -0,0 +1,33 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 2008-03-18 Benjamin Kosnik <bkoz@redhat.com>
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+
+void test01()
+{
+ // Check for required typedefs
+ typedef std::recursive_timed_mutex test_type;
+ typedef test_type::native_handle_type type;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc
new file mode 100644
index 000000000..d61f821c6
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc
@@ -0,0 +1,52 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+
+ try
+ {
+ mutex_type m;
+ bool b = m.try_lock();
+ VERIFY( b );
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc
new file mode 100644
index 000000000..0e95bab94
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc
@@ -0,0 +1,64 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options "-std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options "-std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options "-std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+
+ try
+ {
+ mutex_type m;
+ m.lock();
+ bool b;
+
+ try
+ {
+ b = m.try_lock();
+ VERIFY( b );
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+
+ m.unlock();
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc
new file mode 100644
index 000000000..d4e7d0a2f
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc
@@ -0,0 +1,53 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <chrono>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+
+ try
+ {
+ mutex_type m;
+ bool b = m.try_lock_for(std::chrono::seconds(1));
+ VERIFY( b );
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc
new file mode 100644
index 000000000..207cad6ac
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc
@@ -0,0 +1,54 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <chrono>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+ typedef std::chrono::duration<int64_t, std::pico> picoseconds;
+
+ try
+ {
+ mutex_type m;
+ bool b = m.try_lock_for(picoseconds(1));
+ VERIFY( b );
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc
new file mode 100644
index 000000000..d4a93484b
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc
@@ -0,0 +1,70 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+
+ std::chrono::seconds s(1);
+
+ try
+ {
+ mutex_type m;
+ m.lock();
+ bool b;
+
+ try
+ {
+ b = m.try_lock_for(s);
+ VERIFY( b );
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch(...)
+ {
+ VERIFY( false );
+ }
+
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc
new file mode 100644
index 000000000..d61f821c6
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc
@@ -0,0 +1,52 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+
+ try
+ {
+ mutex_type m;
+ bool b = m.try_lock();
+ VERIFY( b );
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc
new file mode 100644
index 000000000..911686c76
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc
@@ -0,0 +1,63 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+
+ try
+ {
+ mutex_type m;
+ m.lock();
+ bool b;
+
+ try
+ {
+ b = m.try_lock();
+ VERIFY( b );
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc
new file mode 100644
index 000000000..a1e4458f2
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc
@@ -0,0 +1,52 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::recursive_timed_mutex mutex_type;
+
+ try
+ {
+ // Unlock mutex that hasn't been locked.
+ mutex_type m;
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ // POSIX == EPERM
+ VERIFY( true );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}