diff mbox series

[committed] testuite: Check pthread for omp module testing

Message ID 20210519145809.16239-1-kito.cheng@sifive.com
State New
Headers show
Series [committed] testuite: Check pthread for omp module testing | expand

Commit Message

Kito Cheng May 19, 2021, 2:58 p.m. UTC
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(+)

Comments

Bernd Edlinger May 20, 2021, 6:27 p.m. UTC | #1
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.
diff mbox series

Patch

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;