diff options
author | Tom de Vries <tom@codesourcery.com> | 2017-10-19 08:11:26 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2017-10-19 08:11:26 +0000 |
commit | 7ff6bdb7278fcd66b0e2f1d38ed9a31733449f78 (patch) | |
tree | a3876c73b1a3ecb25b40b3cb3ac624d1932c1b44 /gcc | |
parent | 439d2350251a050f4d00ae4af1d2dff5c569d52e (diff) | |
download | gcc-7ff6bdb7278fcd66b0e2f1d38ed9a31733449f78.zip gcc-7ff6bdb7278fcd66b0e2f1d38ed9a31733449f78.tar.gz gcc-7ff6bdb7278fcd66b0e2f1d38ed9a31733449f78.tar.bz2 |
Add dg-require-stack-size
2017-10-19 Tom de Vries <tom@codesourcery.com>
* lib/target-supports-dg.exp (dg-require-stack-size): New proc.
* gcc.c-torture/execute/20030209-1.c: Use dg-require-stack-size.
* gcc.c-torture/execute/20040805-1.c: Same.
* gcc.c-torture/execute/920410-1.c: Same.
* gcc.c-torture/execute/921113-1.c: Same.
* gcc.c-torture/execute/921208-2.c: Same.
* gcc.c-torture/execute/comp-goto-1.c: Same.
* gcc.c-torture/execute/pr20621-1.c: Same.
* gcc.c-torture/execute/pr28982b.c: Same.
* gcc.dg/tree-prof/comp-goto-1.c: Same.
* doc/sourcebuild.texi (Test Directives, Variants of
dg-require-support): Add dg-require-stack-size.
From-SVN: r253882
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/doc/sourcebuild.texi | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20030209-1.c | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20040805-1.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/920410-1.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/921113-1.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/921208-2.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr20621-1.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr28982b.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports-dg.exp | 15 |
13 files changed, 50 insertions, 52 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7f5b9f4..91a2917 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-10-19 Tom de Vries <tom@codesourcery.com> + + * doc/sourcebuild.texi (Test Directives, Variants of + dg-require-support): Add dg-require-stack-size. + 2017-10-19 Martin Liska <mliska@suse.cz> PR sanitizer/82517 diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index a2f0429..7d6d4a3 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2358,6 +2358,9 @@ Skip the test if the target does not support the @code{-fstack-check} option. If @var{check} is @code{""}, support for @code{-fstack-check} is checked, for @code{-fstack-check=("@var{check}")} otherwise. +@item dg-require-stack-size @var{size} +Skip the test if the target does not support a stack size of @var{size}. + @item dg-require-visibility @var{vis} Skip the test if the target does not support the @code{visibility} attribute. If @var{vis} is @code{""}, support for @code{visibility("hidden")} is diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a30186a..f48860a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2017-10-19 Tom de Vries <tom@codesourcery.com> + + * lib/target-supports-dg.exp (dg-require-stack-size): New proc. + * gcc.c-torture/execute/20030209-1.c: Use dg-require-stack-size. + * gcc.c-torture/execute/20040805-1.c: Same. + * gcc.c-torture/execute/920410-1.c: Same. + * gcc.c-torture/execute/921113-1.c: Same. + * gcc.c-torture/execute/921208-2.c: Same. + * gcc.c-torture/execute/comp-goto-1.c: Same. + * gcc.c-torture/execute/pr20621-1.c: Same. + * gcc.c-torture/execute/pr28982b.c: Same. + * gcc.dg/tree-prof/comp-goto-1.c: Same. + 2017-10-19 Martin Liska <mliska@suse.cz> PR sanitizer/82517 diff --git a/gcc/testsuite/gcc.c-torture/execute/20030209-1.c b/gcc/testsuite/gcc.c-torture/execute/20030209-1.c index 8f076ec..52f71ec 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20030209-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20030209-1.c @@ -1,12 +1,5 @@ -/* { dg-add-options stack_size } */ +/* { dg-require-stack-size "8*100*100" } */ -#ifdef STACK_SIZE -#if STACK_SIZE < 8*100*100 -#define SKIP -#endif -#endif - -#ifndef SKIP double x[100][100]; int main () { @@ -18,10 +11,3 @@ int main () abort (); exit (0); } -#else -int -main () -{ - exit (0); -} -#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/20040805-1.c b/gcc/testsuite/gcc.c-torture/execute/20040805-1.c index d3208d6..f311092 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20040805-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20040805-1.c @@ -1,6 +1,6 @@ -/* { dg-add-options stack_size } */ +/* { dg-require-stack-size "0x12000" } */ -#if __INT_MAX__ < 32768 || (defined(STACK_SIZE) && STACK_SIZE < 0x12000) +#if __INT_MAX__ < 32768 int main () { exit (0); } #else int a[2] = { 2, 3 }; diff --git a/gcc/testsuite/gcc.c-torture/execute/920410-1.c b/gcc/testsuite/gcc.c-torture/execute/920410-1.c index 44a72bd..daeff5e 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920410-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/920410-1.c @@ -1,8 +1,4 @@ -/* { dg-add-options stack_size } */ +/* { dg-require-stack-size "40000 * 4 + 256" } */ -#define STACK_REQUIREMENT (40000 * 4 + 256) -#if defined (STACK_SIZE) && STACK_SIZE < STACK_REQUIREMENT -main () { exit (0); } -#else main(){int d[40000];d[0]=0;exit(0);} -#endif + diff --git a/gcc/testsuite/gcc.c-torture/execute/921113-1.c b/gcc/testsuite/gcc.c-torture/execute/921113-1.c index d3e44e3..824e69f 100644 --- a/gcc/testsuite/gcc.c-torture/execute/921113-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/921113-1.c @@ -1,9 +1,4 @@ -/* { dg-add-options stack_size } */ - -#define STACK_REQUIREMENT (128 * 128 * 4 + 1024) -#if defined (STACK_SIZE) && STACK_SIZE < STACK_REQUIREMENT -main () { exit (0); } -#else +/* { dg-require-stack-size "128 * 128 * 4 + 1024" } */ typedef struct { float wsx; @@ -62,4 +57,3 @@ main() exit(0); } -#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/921208-2.c b/gcc/testsuite/gcc.c-torture/execute/921208-2.c index da9ee52..01e14f8 100644 --- a/gcc/testsuite/gcc.c-torture/execute/921208-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/921208-2.c @@ -1,10 +1,5 @@ /* { dg-require-effective-target untyped_assembly } */ -/* { dg-add-options stack_size } */ - -#define STACK_REQUIREMENT (100000 * 4 + 1024) -#if defined (STACK_SIZE) && STACK_SIZE < STACK_REQUIREMENT -main () { exit (0); } -#else +/* { dg-require-stack-size "100000 * 4 + 1024" } */ g(){} @@ -25,5 +20,3 @@ main () f(); exit(0); } - -#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c index 2a84052..4379fe7 100644 --- a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c @@ -1,9 +1,9 @@ /* { dg-require-effective-target label_values } */ -/* { dg-add-options stack_size } */ +/* { dg-require-stack-size "4000" } */ #include <stdlib.h> -#if (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647 +#if __INT_MAX__ >= 2147483647 typedef unsigned int uint32; typedef signed int sint32; diff --git a/gcc/testsuite/gcc.c-torture/execute/pr20621-1.c b/gcc/testsuite/gcc.c-torture/execute/pr20621-1.c index 9d0119b..b2a9785 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr20621-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr20621-1.c @@ -1,12 +1,9 @@ -/* { dg-add-options stack_size } */ +/* { dg-require-stack-size "0x10000" } */ /* When generating o32 MIPS PIC, main's $gp save slot was out of range of a single load instruction. */ struct big { int i[sizeof (int) >= 4 && sizeof (void *) >= 4 ? 0x4000 : 4]; }; struct big gb; int foo (struct big b, int x) { return b.i[x]; } -#if defined(STACK_SIZE) && STACK_SIZE <= 0x10000 -int main (void) { return 0; } -#else int main (void) { return foo (gb, 0) + foo (gb, 1); } -#endif + diff --git a/gcc/testsuite/gcc.c-torture/execute/pr28982b.c b/gcc/testsuite/gcc.c-torture/execute/pr28982b.c index f28425e..b68fa9a 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr28982b.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr28982b.c @@ -1,11 +1,8 @@ -/* { dg-add-options stack_size } */ +/* { dg-require-stack-size "0x80100" } */ /* Like pr28982a.c, but with the spill slots outside the range of a single sp-based load on ARM. This test tests for cases where the addresses in the base and index reloads require further reloads. */ -#if defined(STACK_SIZE) && STACK_SIZE <= 0x80100 -int main (void) { return 0; } -#else #define NITER 4 #define NVARS 20 #define MULTI(X) \ @@ -57,4 +54,3 @@ main (void) return 1; return 0; } -#endif diff --git a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c index fe768f9..baed1e3 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c +++ b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c @@ -1,11 +1,11 @@ /* { dg-require-effective-target freorder } */ /* { dg-require-effective-target label_values } */ /* { dg-options "-O2 -freorder-blocks-and-partition" } */ -/* { dg-add-options stack_size } */ +/* { dg-require-stack-size "4000" } */ #include <stdlib.h> -#if (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647 +#if __INT_MAX__ >= 2147483647 typedef unsigned int uint32; typedef signed int sint32; diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp index d50d8b0..6080421f 100644 --- a/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc/testsuite/lib/target-supports-dg.exp @@ -180,6 +180,21 @@ proc dg-require-iconv { args } { } } +# If this target does not have sufficient stack size, skip this test. + +proc dg-require-stack-size { args } { + if { ![is-effective-target stack_size] } { + return + } + + set stack_size [dg-effective-target-value stack_size] + set required [expr [lindex $args 1]] + if { $stack_size < $required } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } +} + # If this target does not support named sections skip this test. proc dg-require-named-sections { args } { |