testsuite: Add signal checking for signal related testcase in analyzer.

- 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.
This commit is contained in:
Kito Cheng 2020-07-20 14:41:04 +08:00
parent 2ef4cf87a7
commit c850a642e1
8 changed files with 8 additions and 0 deletions

View File

@ -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>

View File

@ -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>

View File

@ -1,3 +1,4 @@
/* { dg-require-effective-target signal } */
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>

View File

@ -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>

View File

@ -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>

View File

@ -1,4 +1,5 @@
/* Example of other bad calls within a signal handler. */
/* { dg-require-effective-target signal } */
#include <stdlib.h>
#include <signal.h>

View File

@ -1,3 +1,4 @@
/* { dg-require-effective-target signal } */
#include <stdio.h>
#include <signal.h>

View File

@ -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>