[testsuite] require pthread for openmp

Message ID orzg5upaqt.fsf@lxoliva.fsfla.org
State Accepted
Headers
Series [testsuite] require pthread for openmp |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Alexandre Oliva May 24, 2023, 5:19 a.m. UTC
  Fix test that uses -fopenmp without declaring requirement for pthread
support.

Bootstrapped on x86_64-linux-gnu.  Also tested on ppc- and x86-vx7r2
with gcc-12.

for  gcc/testsuite/ChangeLog

	* g++.dg/pr80481.C: Add explicit pthread requirement.
---
 gcc/testsuite/g++.dg/pr80481.C |    2 ++
 1 file changed, 2 insertions(+)
  

Comments

Richard Biener May 24, 2023, 9:03 a.m. UTC | #1
On Wed, May 24, 2023 at 7:20 AM Alexandre Oliva via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
>
> Fix test that uses -fopenmp without declaring requirement for pthread
> support.
>
> Bootstrapped on x86_64-linux-gnu.  Also tested on ppc- and x86-vx7r2
> with gcc-12.

OK

> for  gcc/testsuite/ChangeLog
>
>         * g++.dg/pr80481.C: Add explicit pthread requirement.
> ---
>  gcc/testsuite/g++.dg/pr80481.C |    2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/gcc/testsuite/g++.dg/pr80481.C b/gcc/testsuite/g++.dg/pr80481.C
> index 78c463b8e3b58..3a8869914634f 100644
> --- a/gcc/testsuite/g++.dg/pr80481.C
> +++ b/gcc/testsuite/g++.dg/pr80481.C
> @@ -1,4 +1,6 @@
>  // { dg-do compile { target { i?86-*-* x86_64-*-* }  && { ! *-*-solaris* } } }
> +// -fopenmp implies -pthread
> +// { dg-require-effective-target pthread }
>  // { dg-options "-Ofast -funroll-loops -fopenmp -march=knl" }
>  // Disabling epilogues until we find a better way to deal with scans.
>  // { dg-additional-options "--param vect-epilogues-nomask=0" }
>
> --
> Alexandre Oliva, happy hacker                https://FSFLA.org/blogs/lxo/
>    Free Software Activist                       GNU Toolchain Engineer
> Disinformation flourishes because many people care deeply about injustice
> but very few check the facts.  Ask me about <https://stallmansupport.org>
  

Patch

diff --git a/gcc/testsuite/g++.dg/pr80481.C b/gcc/testsuite/g++.dg/pr80481.C
index 78c463b8e3b58..3a8869914634f 100644
--- a/gcc/testsuite/g++.dg/pr80481.C
+++ b/gcc/testsuite/g++.dg/pr80481.C
@@ -1,4 +1,6 @@ 
 // { dg-do compile { target { i?86-*-* x86_64-*-* }  && { ! *-*-solaris* } } }
+// -fopenmp implies -pthread
+// { dg-require-effective-target pthread } 
 // { dg-options "-Ofast -funroll-loops -fopenmp -march=knl" }
 // Disabling epilogues until we find a better way to deal with scans.
 // { dg-additional-options "--param vect-epilogues-nomask=0" }