* [PATCH] PR libstdc++/89023 fix test that fails when <omp.h> not available
@ 2019-02-11 12:57 Jonathan Wakely
0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2019-02-11 12:57 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 727 bytes --]
Instead of a single test that only checks whether <regex> can be
included in Parallel Mode, add tests for each of C++11/C++14/C++17 that
check whether <bits/extc++.h> is compatible with _GLIBCXX_PARALLEL.
This increases the coverage to (almost) all headers.
If <omp.h> is not available then the tests will trivially pass, because
we don't care about compatibility with _GLIBCXX_PARALLEL in that case.
PR libstdc++/89023
* testsuite/17_intro/headers/c++2011/parallel_mode.cc: New test.
* testsuite/17_intro/headers/c++2014/parallel_mode.cc: New test.
* testsuite/17_intro/headers/c++2017/parallel_mode.cc: New test.
* testsuite/28_regex/headers/regex/parallel_mode.cc: Remove.
Tested x86_64-linux, committed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 4550 bytes --]
commit 4e00db1844ee703699865a4f2fb0a9e27a4087c7
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Mon Feb 11 12:22:05 2019 +0000
PR libstdc++/89023 fix test that fails when <omp.h> not available
Instead of a single test that only checks whether <regex> can be
included in Parallel Mode, add tests for each of C++11/C++14/C++17 that
check whether <bits/extc++.h> is compatible with _GLIBCXX_PARALLEL.
This increases the coverage to (almost) all headers.
If <omp.h> is not available then the tests will trivially pass, because
we don't care about compatibility with _GLIBCXX_PARALLEL in that case.
PR libstdc++/89023
* testsuite/17_intro/headers/c++2011/parallel_mode.cc: New test.
* testsuite/17_intro/headers/c++2014/parallel_mode.cc: New test.
* testsuite/17_intro/headers/c++2017/parallel_mode.cc: New test.
* testsuite/28_regex/headers/regex/parallel_mode.cc: Remove.
diff --git a/libstdc++-v3/testsuite/28_regex/headers/regex/parallel_mode.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/parallel_mode.cc
similarity index 81%
rename from libstdc++-v3/testsuite/28_regex/headers/regex/parallel_mode.cc
rename to libstdc++-v3/testsuite/17_intro/headers/c++2011/parallel_mode.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/parallel_mode.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2019 Free Software Foundation, Inc.
+// Copyright (C) 2019 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
@@ -15,8 +15,11 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
+// { dg-options "-std=gnu++11" }
// { dg-do compile { target c++11 } }
// { dg-require-normal-mode "" }
-#define _GLIBCXX_PARALLEL
-#include <regex>
+#if __has_include(<omp.h>)
+# define _GLIBCXX_PARALLEL 1
+# include <bits/extc++.h>
+#endif
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/parallel_mode.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/parallel_mode.cc
new file mode 100644
index 00000000000..a8184540b7c
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/parallel_mode.cc
@@ -0,0 +1,25 @@
+// Copyright (C) 2019 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/>.
+
+// { dg-options "-std=gnu++14" }
+// { dg-do compile { target c++14 } }
+// { dg-require-normal-mode "" }
+
+#if __has_include(<omp.h>)
+# define _GLIBCXX_PARALLEL 1
+# include <bits/extc++.h>
+#endif
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2017/parallel_mode.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2017/parallel_mode.cc
new file mode 100644
index 00000000000..e84f59e5819
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2017/parallel_mode.cc
@@ -0,0 +1,25 @@
+// Copyright (C) 2019 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/>.
+
+// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++17 } }
+// { dg-require-normal-mode "" }
+
+#if __has_include(<omp.h>)
+# define _GLIBCXX_PARALLEL 1
+# include <bits/extc++.h>
+#endif
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-02-11 12:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11 12:57 [PATCH] PR libstdc++/89023 fix test that fails when <omp.h> not available Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).