On 5/19/21 4:58 PM, Kito Cheng wrote: > gcc/testsuite/ChangeLog: > > * g++.dg/modules/omp-1_a.C: Check pthread is available. > * g++.dg/modules/omp-1_b.C: Ditto. > * g++.dg/modules/omp-1_c.C: Ditto. > * g++.dg/modules/omp-2_a.C: Ditto. > * g++.dg/modules/omp-2_b.C: Ditto. > --- > gcc/testsuite/g++.dg/modules/omp-1_a.C | 1 + > gcc/testsuite/g++.dg/modules/omp-1_b.C | 1 + > gcc/testsuite/g++.dg/modules/omp-1_c.C | 1 + > gcc/testsuite/g++.dg/modules/omp-2_a.C | 1 + > gcc/testsuite/g++.dg/modules/omp-2_b.C | 1 + > 5 files changed, 5 insertions(+) > > diff --git a/gcc/testsuite/g++.dg/modules/omp-1_a.C > b/gcc/testsuite/g++.dg/modules/omp-1_a.C > index 722720a0e93..94e1171f03c 100644 > --- a/gcc/testsuite/g++.dg/modules/omp-1_a.C > +++ b/gcc/testsuite/g++.dg/modules/omp-1_a.C > @@ -1,4 +1,5 @@ > // { dg-additional-options "-fmodules-ts -fopenmp" } > +// { dg-require-effective-target pthread } > > export module foo; > // { dg-module-cmi foo } > diff --git a/gcc/testsuite/g++.dg/modules/omp-1_b.C > b/gcc/testsuite/g++.dg/modules/omp-1_b.C > index f3f5d92e517..09d97e4ac4e 100644 > --- a/gcc/testsuite/g++.dg/modules/omp-1_b.C > +++ b/gcc/testsuite/g++.dg/modules/omp-1_b.C > @@ -1,4 +1,5 @@ > // { dg-additional-options "-fmodules-ts -fopenmp" } > +// { dg-require-effective-target pthread } > > import foo; > > diff --git a/gcc/testsuite/g++.dg/modules/omp-1_c.C > b/gcc/testsuite/g++.dg/modules/omp-1_c.C > index f30f6115277..599a5a5d34f 100644 > --- a/gcc/testsuite/g++.dg/modules/omp-1_c.C > +++ b/gcc/testsuite/g++.dg/modules/omp-1_c.C > @@ -1,4 +1,5 @@ > // { dg-additional-options "-fmodules-ts" } > +// { dg-require-effective-target pthread } > > import foo; > > diff --git a/gcc/testsuite/g++.dg/modules/omp-2_a.C > b/gcc/testsuite/g++.dg/modules/omp-2_a.C > index d2291b6bbe0..b0d4bbc6e8a 100644 > --- a/gcc/testsuite/g++.dg/modules/omp-2_a.C > +++ b/gcc/testsuite/g++.dg/modules/omp-2_a.C > @@ -1,4 +1,5 @@ > // { dg-additional-options "-fmodules-ts -fopenmp" } > +// { dg-require-effective-target pthread } > > export module foo; > // { dg-module-cmi foo } > diff --git a/gcc/testsuite/g++.dg/modules/omp-2_b.C > b/gcc/testsuite/g++.dg/modules/omp-2_b.C > index 39f34c70275..aeee4d1561a 100644 > --- a/gcc/testsuite/g++.dg/modules/omp-2_b.C > +++ b/gcc/testsuite/g++.dg/modules/omp-2_b.C > @@ -1,4 +1,5 @@ > // { dg-additional-options "-fmodules-ts" } > +// { dg-require-effective-target pthread } > > import foo; > >
Hi, this patch causes a couple test failures. FAIL: g++.dg/modules/omp-1_c.C -std=c++17 dg-regexp 6 not found: "In module imported at [^\\n]*omp-1_c.C:3:1:\\nfoo: error: module contains OpenMP, use '-fopenmp' to enable\\n" FAIL: g++.dg/modules/omp-1_c.C -std=c++17 (test for excess errors) FAIL: g++.dg/modules/omp-1_c.C -std=c++2a dg-regexp 6 not found: "In module imported at [^\\n]*omp-1_c.C:3:1:\\nfoo: error: module contains OpenMP, use '-fopenmp' to enable\\n" FAIL: g++.dg/modules/omp-1_c.C -std=c++2a (test for excess errors) FAIL: g++.dg/modules/omp-1_c.C -std=c++2b dg-regexp 6 not found: "In module imported at [^\\n]*omp-1_c.C:3:1:\\nfoo: error: module contains OpenMP, use '-fopenmp' to enable\\n" FAIL: g++.dg/modules/omp-1_c.C -std=c++2b (test for excess errors) That's because the line number in the pattern match changes from 3 to 4. I've adjusted this test with the following patch tested on x86_64-pc-linux-gnu and committed as obvious: Regards Bernd.
From 4f4a2f199baf46d35492edadc16f30f32920c4df Mon Sep 17 00:00:00 2001 From: Bernd Edlinger <bernd.edlin...@hotmail.de> Date: Thu, 20 May 2021 20:19:43 +0200 Subject: [PATCH] Fix a test failure in g++.dg/modules/omp-1_c.C Adjust the line number due to previous commit, which added a line for dg-require-effective-target. 2021-05-20 Bernd Edlinger <bernd.edlin...@hotmail.de> * g++.dg/modules/omp-1_c.C: Fix testcase. --- gcc/testsuite/g++.dg/modules/omp-1_c.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/g++.dg/modules/omp-1_c.C b/gcc/testsuite/g++.dg/modules/omp-1_c.C index 599a5a5..71a24f6 100644 --- a/gcc/testsuite/g++.dg/modules/omp-1_c.C +++ b/gcc/testsuite/g++.dg/modules/omp-1_c.C @@ -3,7 +3,7 @@ import foo; -// { dg-regexp "In module imported at \[^\n]*omp-1_c.C:3:1:\nfoo: error: module contains OpenMP, use '-fopenmp' to enable\n" } +// { dg-regexp "In module imported at \[^\n]*omp-1_c.C:4:1:\nfoo: error: module contains OpenMP, use '-fopenmp' to enable\n" } // { dg-prune-output "failed to read" } // { dg-prune-output "fatal error:" } // { dg-prune-output "compilation terminated" } -- 1.9.1