[committed] testsuite: Add signal checking for signal related testcase in analyzer.

Message ID 20200721062838.32409-1-kito.cheng@sifive.com
State New
Headers show
Series
  • [committed] testsuite: Add signal checking for signal related testcase in analyzer.
Related show

Commit Message

Kito Cheng July 21, 2020, 6:28 a.m.
- Verifed on RISC-V and x86.

gcc/testsuite/ChangeLog:

	* gcc.dg/analyzer/signal-1.c: Add dg-require-effective-target
	signal.
	* gcc.dg/analyzer/signal-2.c: Ditto.
	* gcc.dg/analyzer/signal-3.c: Ditto.
	* gcc.dg/analyzer/signal-4a.c: Ditto.
	* gcc.dg/analyzer/signal-4b.c: Ditto.
	* gcc.dg/analyzer/signal-5.c: Ditto.
	* gcc.dg/analyzer/signal-6.c: Ditto.
	* gcc.dg/analyzer/signal-exit.c: Ditto.
---
 gcc/testsuite/gcc.dg/analyzer/signal-1.c    | 1 +
 gcc/testsuite/gcc.dg/analyzer/signal-2.c    | 1 +
 gcc/testsuite/gcc.dg/analyzer/signal-3.c    | 1 +
 gcc/testsuite/gcc.dg/analyzer/signal-4a.c   | 1 +
 gcc/testsuite/gcc.dg/analyzer/signal-4b.c   | 1 +
 gcc/testsuite/gcc.dg/analyzer/signal-5.c    | 1 +
 gcc/testsuite/gcc.dg/analyzer/signal-6.c    | 1 +
 gcc/testsuite/gcc.dg/analyzer/signal-exit.c | 1 +
 8 files changed, 8 insertions(+)

-- 
2.27.0

Comments

Ian Lance Taylor via Gcc-patches July 21, 2020, 12:45 p.m. | #1
On Tue, 2020-07-21 at 14:28 +0800, Kito Cheng wrote:
>  - Verifed on RISC-V and x86.

> 

> gcc/testsuite/ChangeLog:

> 

> 	* gcc.dg/analyzer/signal-1.c: Add dg-require-effective-target

> 	signal.

> 	* gcc.dg/analyzer/signal-2.c: Ditto.

> 	* gcc.dg/analyzer/signal-3.c: Ditto.

> 	* gcc.dg/analyzer/signal-4a.c: Ditto.

> 	* gcc.dg/analyzer/signal-4b.c: Ditto.

> 	* gcc.dg/analyzer/signal-5.c: Ditto.

> 	* gcc.dg/analyzer/signal-6.c: Ditto.

> 	* gcc.dg/analyzer/signal-exit.c: Ditto.

> ---

>  gcc/testsuite/gcc.dg/analyzer/signal-1.c    | 1 +

>  gcc/testsuite/gcc.dg/analyzer/signal-2.c    | 1 +

>  gcc/testsuite/gcc.dg/analyzer/signal-3.c    | 1 +

>  gcc/testsuite/gcc.dg/analyzer/signal-4a.c   | 1 +

>  gcc/testsuite/gcc.dg/analyzer/signal-4b.c   | 1 +

>  gcc/testsuite/gcc.dg/analyzer/signal-5.c    | 1 +

>  gcc/testsuite/gcc.dg/analyzer/signal-6.c    | 1 +

>  gcc/testsuite/gcc.dg/analyzer/signal-exit.c | 1 +

>  8 files changed, 8 insertions(+)


Thanks.

Patch

diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-1.c b/gcc/testsuite/gcc.dg/analyzer/signal-1.c
index 4dcbcc0fc6bd..43f911ba648b 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-1.c
@@ -1,6 +1,7 @@ 
 /* Example of a bad call within a signal handler.
    'handler' calls 'custom_logger' which calls 'fprintf', and 'fprintf' is
    not allowed from a signal handler.  */
+/* { dg-require-effective-target signal } */
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-2.c b/gcc/testsuite/gcc.dg/analyzer/signal-2.c
index a56acb060ec8..d047c677c419 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-2.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-2.c
@@ -1,6 +1,7 @@ 
 /* Example of a bad call within a signal handler.
    'handler' calls 'custom_logger' which calls 'fprintf', and 'fprintf' is
    not allowed from a signal handler.  */
+/* { dg-require-effective-target signal } */
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-3.c b/gcc/testsuite/gcc.dg/analyzer/signal-3.c
index 5b3088887771..f5072b52f08b 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-3.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-3.c
@@ -1,3 +1,4 @@ 
+/* { dg-require-effective-target signal } */
 #include <stdio.h>
 #include <signal.h>
 #include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-4a.c b/gcc/testsuite/gcc.dg/analyzer/signal-4a.c
index 4b68b6d045b9..4ee6f0e7d0e0 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-4a.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-4a.c
@@ -2,6 +2,7 @@ 
 
 /* { dg-options "-fanalyzer -fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
 /* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target signal } */
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-4b.c b/gcc/testsuite/gcc.dg/analyzer/signal-4b.c
index 38d402473574..cb1e7e475ae3 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-4b.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-4b.c
@@ -2,6 +2,7 @@ 
 
 /* { dg-options "-fanalyzer -fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
 /* { dg-enable-nn-line-numbers "" } */
+/* { dg-require-effective-target signal } */
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-5.c b/gcc/testsuite/gcc.dg/analyzer/signal-5.c
index 4e464fffda54..81ac812ebbd3 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-5.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-5.c
@@ -1,4 +1,5 @@ 
 /* Example of other bad calls within a signal handler.  */
+/* { dg-require-effective-target signal } */
 
 #include <stdlib.h>
 #include <signal.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-6.c b/gcc/testsuite/gcc.dg/analyzer/signal-6.c
index f51845167f5c..ea2290c4296a 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-6.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-6.c
@@ -1,3 +1,4 @@ 
+/* { dg-require-effective-target signal } */
 #include <stdio.h>
 #include <signal.h>
 
diff --git a/gcc/testsuite/gcc.dg/analyzer/signal-exit.c b/gcc/testsuite/gcc.dg/analyzer/signal-exit.c
index a567124c7d4d..41a819b838c8 100644
--- a/gcc/testsuite/gcc.dg/analyzer/signal-exit.c
+++ b/gcc/testsuite/gcc.dg/analyzer/signal-exit.c
@@ -1,6 +1,7 @@ 
 /* Example of a bad call within a signal handler with replacement
    alternative.  'handler' calls 'exit', and 'exit' is not allowed
    from a signal handler.  But '_exit' is allowed.  */
+/* { dg-require-effective-target signal } */
 
 #include <signal.h>
 #include <stdlib.h>