Add effective target signal
authorTom de Vries <tom@codesourcery.com>
Sat, 10 Jun 2017 06:59:49 +0000 (06:59 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Sat, 10 Jun 2017 06:59:49 +0000 (06:59 +0000)
2017-06-10  Tom de Vries  <tom@codesourcery.com>

* lib/target-supports.exp (check_effective_target_signal): New proc.
* lib/gcc.exp (gcc_target_compile): Remove appending of
-DSIGNAL_SUPPRESS to additional_flags.
* gcc.c-torture/execute/ieee/ieee.exp: Add -DSIGNAL_SUPPRESS to
additional_flags if effective target signal is not supported by the
target.
* gcc.c-torture/execute/20101011-1.c: Same.
* gcc.dg/c99-stdint-1.c: Same.
* gcc.dg/c99-stdint-2.c: Same.
* gcc.dg/c99-stdint-5.c: Same.
* gcc.dg/c99-stdint-6.c: Same.
* gcc.dg/stdint-width-1.c: Same.

* doc/sourcebuild.texi (Effective-Target Keywords, Environment
attributes): Document signal effective target.

From-SVN: r249091

12 files changed:
gcc/ChangeLog
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20101011-1.c
gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp
gcc/testsuite/gcc.dg/c99-stdint-1.c
gcc/testsuite/gcc.dg/c99-stdint-2.c
gcc/testsuite/gcc.dg/c99-stdint-5.c
gcc/testsuite/gcc.dg/c99-stdint-6.c
gcc/testsuite/gcc.dg/stdint-width-1.c
gcc/testsuite/lib/gcc.exp
gcc/testsuite/lib/target-supports.exp

index 99c54d1299deef304f409b626a8c497bb0df73e7..d55bdf43bd09a903495334d43d92be004f2594b8 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-10  Tom de Vries  <tom@codesourcery.com>
+
+       * doc/sourcebuild.texi (Effective-Target Keywords, Environment
+       attributes): Document signal effective target.
+
 2017-06-10  Tom de Vries  <tom@codesourcery.com>
 
        * doc/sourcebuild.texi (Effective-Target Keywords, Other attributes):
index cdb3a2c883d5d6401377cba01909e052a044889a..e5f0da6a49bd6395cfd00b5a86ebda06277d7a03 100644 (file)
@@ -1973,6 +1973,9 @@ time) should be run on this target.  This can be enabled by setting the
 Test system runs executables on a simulator (i.e. slowly) rather than
 hardware (i.e. fast).
 
+@item signal
+Target has @code{signal.h}.
+
 @item stabs
 Target supports the stabs debugging format.
 
index 7ffa0c0e634ef45881b83a976f8e712ddd26baee..190054e53a95e323cfcdcac052228b8a74901fc6 100644 (file)
@@ -1,3 +1,18 @@
+2017-06-10  Tom de Vries  <tom@codesourcery.com>
+
+       * lib/target-supports.exp (check_effective_target_signal): New proc.
+       * lib/gcc.exp (gcc_target_compile): Remove appending of
+       -DSIGNAL_SUPPRESS to additional_flags.
+       * gcc.c-torture/execute/ieee/ieee.exp: Add -DSIGNAL_SUPPRESS to
+       additional_flags if effective target signal is not supported by the
+       target.
+       * gcc.c-torture/execute/20101011-1.c: Same.
+       * gcc.dg/c99-stdint-1.c: Same.
+       * gcc.dg/c99-stdint-2.c: Same.
+       * gcc.dg/c99-stdint-5.c: Same.
+       * gcc.dg/c99-stdint-6.c: Same.
+       * gcc.dg/stdint-width-1.c: Same.
+
 2017-06-10  Tom de Vries  <tom@codesourcery.com>
 
        * lib/target-supports.exp (check_effective_target_stack_size)
index 899a401dd7567a17385140c7dc85c0b9941dd5bc..dda49a598529083971916857c494d25ea21ac997 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-options "-fnon-call-exceptions" } */
 /* With -fnon-call-exceptions 0 / 0 should not be eliminated.  */
+/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
 
 #ifdef SIGNAL_SUPPRESS
 # define DO_TEST 0
index 26247d6e5be0a4edb1ff07ffd041b7e2aaf4a9a4..043e02ded1bdbfde8ccfa8bc6afd0c35fb6b4e05 100644 (file)
@@ -53,6 +53,10 @@ if { [istarget "alpha*-*-*"]
   lappend additional_flags "-mieee"
 }
 
+if { ![check_effective_target_signal] } {
+    lappend additional_flags "-DSIGNAL_SUPPRESS"
+}
+
 # load support procs
 load_lib c-torture.exp
 
index 530d13025e7998f7fc417a536d8f89ef23ad1bea..f5c2cda77c9c00247e03f148754bdc38ed765b38 100644 (file)
@@ -10,6 +10,7 @@
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors -fhosted" } */
 /* { dg-require-effective-target ptr32plus } */
+/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
 
 #include <limits.h>
 #include <stdint.h>
index 1784b0c413e20348844dc3e73ef8cd9cba17b560..08d9f6023d9f93eea0ea5635c2ed228d7bea0f09 100644 (file)
@@ -3,6 +3,8 @@
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors -ffreestanding" } */
 /* { dg-require-effective-target ptr32plus } */
+/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
+
 /* The test is that there are no diagnostics, so just include the
    hosted version.  */
 #include "c99-stdint-1.c"
index 9c224edc1cbc4893f127b6ca74902cb6d1161fad..60513233a43fc30bfa7b2671d228359679d56116 100644 (file)
@@ -3,6 +3,7 @@
    compilations).  */
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
 
 #include <stdint.h>
 #ifndef SIGNAL_SUPPRESS
index 150666ce6898121cb9d57ad6176e381e435f6161..60ac31ff7dda60196b356ebc2812c09921501e9d 100644 (file)
@@ -2,6 +2,7 @@
    with any system <inttypes.h> header.  */
 /* { dg-do compile { target inttypes_types } } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
 
 #include <inttypes.h>
 #ifndef SIGNAL_SUPPRESS
index a28feee38db0a3766cf5e21e160b3aac7ccffad0..3eba9f6cb15b816d161b29e220436094b64e8fb8 100644 (file)
@@ -1,6 +1,7 @@
 /* Test TS 18661-1 width macros in <stdint.h>.  */
 /* { dg-do compile } */
 /* { dg-options "-std=c11 -ffreestanding" } */
+/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
 
 #include <stddef.h>
 #define __STDC_WANT_IEC_60559_BFP_EXT__
index e4ac239e418f3eeb8008933fd67195141b021d0c..406ec4ac5703df7789871f1593a925159e5fb209 100644 (file)
@@ -141,10 +141,6 @@ proc gcc_target_compile { source dest type options } {
        lappend options "ldflags=$TEST_EXTRA_LIBS"
     }
 
-    if [target_info exists gcc,signal_suppress] {
-       lappend options "additional_flags=-DSIGNAL_SUPPRESS"
-    }
-
     # TEST_ALWAYS_FLAGS are flags that should be passed to every
     # compilation.  They are passed first to allow individual
     # tests to override them.
index d7efc19c0183be81a9ec4a79146679b27631b2a7..31701c23e8f9f88a29e96c56fa08cc9272525347 100644 (file)
@@ -525,6 +525,15 @@ proc dg-effective-target-value { effective_target } {
     return 0
 }
 
+# Return 1 if signal.h is supported.
+
+proc check_effective_target_signal { } {
+    if [target_info exists gcc,signal_suppress] {
+      return 0
+    }
+    return 1
+}
+
 # Return 1 if according to target_info struct and explicit target list
 # target disables -fdelete-null-pointer-checks.  Targets should return 0
 # if they simply default to -fno-delete-null-pointer-checks but obey