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
+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
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
+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
-/* { 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 ()
{
abort ();
exit (0);
}
-#else
-int
-main ()
-{
- exit (0);
-}
-#endif
-/* { 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 };
-/* { 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
+
-/* { 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;
exit(0);
}
-#endif
/* { 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(){}
f();
exit(0);
}
-
-#endif
/* { 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;
-/* { 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
+
-/* { 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) \
return 1;
return 0;
}
-#endif
/* { 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;
}
}
+# 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 } {