aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2018-07-26 21:23:12 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2018-07-26 21:23:12 +0000
commitccfe77fa220de72e10ca8818d65d3b2b73a2e062 (patch)
tree8ea920238afcd92ac71793ff7e9aa1d6da0ed21b
parent2686c842da8f402231d0c316687409dc1b821ea0 (diff)
downloadgcc-ccfe77fa220de72e10ca8818d65d3b2b73a2e062.zip
gcc-ccfe77fa220de72e10ca8818d65d3b2b73a2e062.tar.gz
gcc-ccfe77fa220de72e10ca8818d65d3b2b73a2e062.tar.bz2
* 30_threads/condition_variable_any/cond.cc: New test.
From-SVN: r263022
-rw-r--r--libstdc++-v3/ChangeLog4
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable_any/cond.cc35
2 files changed, 39 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 204b89b..00fb914 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,9 @@
2018-07-26 Marek Polacek <polacek@redhat.com>
+ * testsuite/30_threads/condition_variable_any/cond.cc: New.
+
+2018-07-26 Marek Polacek <polacek@redhat.com>
+
* src/c++98/locale_init.cc: Fix #ifdef condition.
2018-07-26 Jonathan Wakely <jwakely@redhat.com>
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable_any/cond.cc b/libstdc++-v3/testsuite/30_threads/condition_variable_any/cond.cc
new file mode 100644
index 0000000..82a9e66
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable_any/cond.cc
@@ -0,0 +1,35 @@
+// { dg-do run }
+// { dg-options "-pthread" }
+// { dg-require-effective-target c++11 }
+// { dg-require-effective-target pthread }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2018 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 <condition_variable>
+#include <cstring>
+
+int main()
+{
+ const size_t sz = sizeof(std::condition_variable_any);
+ char garbage[sz];
+ memset(garbage, 0xff, sz);
+ auto cond = new ((void*)garbage) std::condition_variable_any();
+ cond->notify_all();
+ cond->~condition_variable_any();
+}