diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2014-11-10 16:30:09 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2014-11-10 16:30:09 +0000 |
commit | e2acc079ff125a869159be45371dc0a29b230e92 (patch) | |
tree | cb56aa5f84330cfa7f21cc303183f012b3cda690 | |
parent | 738f25224b78c40ba48d6debd95946bf73f89e53 (diff) | |
download | gcc-e2acc079ff125a869159be45371dc0a29b230e92.zip gcc-e2acc079ff125a869159be45371dc0a29b230e92.tar.gz gcc-e2acc079ff125a869159be45371dc0a29b230e92.tar.bz2 |
Testsuite alloca fixes for ptx.
* lib/target-supports.exp (check_effective_target_alloca): New function.
* gcc.c-torture/execute/20010209-1.c: Require alloca.
* gcc.c-torture/execute/20020314-1.c: Likewise.
* gcc.c-torture/execute/20020412-1.c: Likewise.
* gcc.c-torture/execute/20021113-1.c: Likewise.
* gcc.c-torture/execute/20040223-1.c: Likewise.
* gcc.c-torture/execute/20040308-1.c: Likewise.
* gcc.c-torture/execute/20040811-1.c: Likewise.
* gcc.c-torture/execute/20070824-1.c: Likewise.
* gcc.c-torture/execute/20070919-1.c: Likewise.
* gcc.c-torture/execute/built-in-setjmp.c: Likewise.
* gcc.c-torture/execute/pr22061-1.c: Likewise.
* gcc.c-torture/execute/pr22061-4.c: Likewise.
* gcc.c-torture/execute/pr43220.c: Likewise.
* gcc.c-torture/execute/vla-dealloc-1.c: Likewise.
* gcc.dg/torture/stackalign/alloca-1.c: Likewise.
* gcc.dg/torture/stackalign/vararg-1.c: Likewise.
* gcc.dg/torture/stackalign/vararg-2.c: Likewise.
* gcc.c-torture/compile/20000923-1.c: Likewise.
* gcc.c-torture/compile/20030224-1.c: Likewise.
* gcc.c-torture/compile/20071108-1.c: Likewise.
* gcc.c-torture/compile/20071117-1.c: Likewise.
* gcc.c-torture/compile/900313-1.c: Likewise.
* gcc.c-torture/compile/pr17397.c: Likewise.
* gcc.c-torture/compile/pr35006.c: Likewise.
* gcc.c-torture/compile/pr42956.c: Likewise.
* gcc.c-torture/compile/pr51354.c: Likewise.
* gcc.c-torture/compile/pr55851.c: Likewise.
* gcc.c-torture/compile/vla-const-1.c: Likewise.
* gcc.c-torture/compile/vla-const-2.c: Likewise.
* gcc.c-torture/compile/pr31507-1.c: Likewise.
* gcc.c-torture/compile/pr52714.c: Likewise.
* gcc.dg/20001012-2.c: Likewise.
* gcc.dg/auto-type-1.c: Likewise.
* gcc.dg/builtin-object-size-1.c: Likewise.
* gcc.dg/builtin-object-size-2.c: Likewise.
* gcc.dg/builtin-object-size-3.c: Likewise.
* gcc.dg/builtin-object-size-4.c: Likewise.
* gcc.dg/packed-vla.c: Likewise.
* gcc.c-torture/compile/parms.c: Likewise.
* gcc.c-torture/execute/920721-2.c: Skip -O0 unless alloca is available.
* gcc.c-torture/execute/920929-1.c: Likewise.
* gcc.c-torture/execute/921017-1.c: Likewise.
* gcc.c-torture/execute/941202-1.c: Likewise.
* gcc.c-torture/execute/align-nest.c: Likewise.
* gcc.c-torture/execute/alloca-1.c: Likewise.
* gcc.c-torture/execute/pr36321.c: Likewise.
* gcc.c-torture/compile/20001221-1.c: Likewise.
* gcc.c-torture/compile/20020807-1.c: Likewise.
* gcc.c-torture/compile/20050801-2.c: Likewise.
* gcc.c-torture/compile/920428-4.c: Likewise.
* gcc.c-torture/compile/debugvlafunction-1.c.c: Likewise.
* gcc.c-torture/compile/pr41469.c: Likewise.
* gcc.dg/torture/pr48953.c: Likewise.
* gcc.dg/torture/pr8081.c: Likewise.
* gcc.dg/torture/stackalign/inline-1.c: Skip if nvptx-*-*.
* gcc.dg/torture/stackalign/inline-2.c: Likewise.
* gcc.dg/torture/stackalign/nested-1.c: Likewise.
* gcc.dg/torture/stackalign/nested-2.c: Likewise.
* gcc.dg/torture/stackalign/nested-3.c: Likewise.
* gcc.dg/torture/stackalign/nested-4.c: Likewise.
* gcc.dg/torture/stackalign/nested-1.c: Likewise.
* gcc.dg/torture/stackalign/global-1.c: Likewise.
* gcc.dg/torture/stackalign/pr16660-1.c: Likewise.
* gcc.dg/torture/stackalign/pr16660-2.c: Likewise.
* gcc.dg/torture/stackalign/pr16660-3.c: Likewise.
* gcc.dg/torture/stackalign/ret-struct-1.c: Likewise.
* gcc.dg/torture/stackalign/struct-1.c: Likewise.
From-SVN: r217296
68 files changed, 148 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4c96eb6..1691987 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,74 @@ +2014-11-10 Bernd Schmidt <bernds@codesourcery.com> + + * lib/target-supports.exp (check_effective_target_alloca): New function. + * gcc.c-torture/execute/20010209-1.c: Require alloca. + * gcc.c-torture/execute/20020314-1.c: Likewise. + * gcc.c-torture/execute/20020412-1.c: Likewise. + * gcc.c-torture/execute/20021113-1.c: Likewise. + * gcc.c-torture/execute/20040223-1.c: Likewise. + * gcc.c-torture/execute/20040308-1.c: Likewise. + * gcc.c-torture/execute/20040811-1.c: Likewise. + * gcc.c-torture/execute/20070824-1.c: Likewise. + * gcc.c-torture/execute/20070919-1.c: Likewise. + * gcc.c-torture/execute/built-in-setjmp.c: Likewise. + * gcc.c-torture/execute/pr22061-1.c: Likewise. + * gcc.c-torture/execute/pr22061-4.c: Likewise. + * gcc.c-torture/execute/pr43220.c: Likewise. + * gcc.c-torture/execute/vla-dealloc-1.c: Likewise. + * gcc.dg/torture/stackalign/alloca-1.c: Likewise. + * gcc.dg/torture/stackalign/vararg-1.c: Likewise. + * gcc.dg/torture/stackalign/vararg-2.c: Likewise. + * gcc.c-torture/compile/20000923-1.c: Likewise. + * gcc.c-torture/compile/20030224-1.c: Likewise. + * gcc.c-torture/compile/20071108-1.c: Likewise. + * gcc.c-torture/compile/20071117-1.c: Likewise. + * gcc.c-torture/compile/900313-1.c: Likewise. + * gcc.c-torture/compile/pr17397.c: Likewise. + * gcc.c-torture/compile/pr35006.c: Likewise. + * gcc.c-torture/compile/pr42956.c: Likewise. + * gcc.c-torture/compile/pr51354.c: Likewise. + * gcc.c-torture/compile/pr55851.c: Likewise. + * gcc.c-torture/compile/vla-const-1.c: Likewise. + * gcc.c-torture/compile/vla-const-2.c: Likewise. + * gcc.c-torture/compile/pr31507-1.c: Likewise. + * gcc.c-torture/compile/pr52714.c: Likewise. + * gcc.dg/20001012-2.c: Likewise. + * gcc.dg/auto-type-1.c: Likewise. + * gcc.dg/builtin-object-size-1.c: Likewise. + * gcc.dg/builtin-object-size-2.c: Likewise. + * gcc.dg/builtin-object-size-3.c: Likewise. + * gcc.dg/builtin-object-size-4.c: Likewise. + * gcc.dg/packed-vla.c: Likewise. + * gcc.c-torture/compile/parms.c: Likewise. + * gcc.c-torture/execute/920721-2.c: Skip -O0 unless alloca is available. + * gcc.c-torture/execute/920929-1.c: Likewise. + * gcc.c-torture/execute/921017-1.c: Likewise. + * gcc.c-torture/execute/941202-1.c: Likewise. + * gcc.c-torture/execute/align-nest.c: Likewise. + * gcc.c-torture/execute/alloca-1.c: Likewise. + * gcc.c-torture/execute/pr36321.c: Likewise. + * gcc.c-torture/compile/20001221-1.c: Likewise. + * gcc.c-torture/compile/20020807-1.c: Likewise. + * gcc.c-torture/compile/20050801-2.c: Likewise. + * gcc.c-torture/compile/920428-4.c: Likewise. + * gcc.c-torture/compile/debugvlafunction-1.c.c: Likewise. + * gcc.c-torture/compile/pr41469.c: Likewise. + * gcc.dg/torture/pr48953.c: Likewise. + * gcc.dg/torture/pr8081.c: Likewise. + * gcc.dg/torture/stackalign/inline-1.c: Skip if nvptx-*-*. + * gcc.dg/torture/stackalign/inline-2.c: Likewise. + * gcc.dg/torture/stackalign/nested-1.c: Likewise. + * gcc.dg/torture/stackalign/nested-2.c: Likewise. + * gcc.dg/torture/stackalign/nested-3.c: Likewise. + * gcc.dg/torture/stackalign/nested-4.c: Likewise. + * gcc.dg/torture/stackalign/nested-1.c: Likewise. + * gcc.dg/torture/stackalign/global-1.c: Likewise. + * gcc.dg/torture/stackalign/pr16660-1.c: Likewise. + * gcc.dg/torture/stackalign/pr16660-2.c: Likewise. + * gcc.dg/torture/stackalign/pr16660-3.c: Likewise. + * gcc.dg/torture/stackalign/ret-struct-1.c: Likewise. + * gcc.dg/torture/stackalign/struct-1.c: Likewise. + 2014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net> * g++.dg/cpp1y/feat-cxx11.C: Test new feature macros for C++98 diff --git a/gcc/testsuite/gcc.c-torture/compile/20000923-1.c b/gcc/testsuite/gcc.c-torture/compile/20000923-1.c index 9ed9886..3244dc7 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20000923-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20000923-1.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target alloca } */ const int a = 3; const int b = 50; diff --git a/gcc/testsuite/gcc.c-torture/compile/20001221-1.c b/gcc/testsuite/gcc.c-torture/compile/20001221-1.c index 66ae714..1adb0f8 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20001221-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20001221-1.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ static void foo () { diff --git a/gcc/testsuite/gcc.c-torture/compile/20020807-1.c b/gcc/testsuite/gcc.c-torture/compile/20020807-1.c index c1cc815..605986a 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20020807-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20020807-1.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ int x; static int diff --git a/gcc/testsuite/gcc.c-torture/compile/20030224-1.c b/gcc/testsuite/gcc.c-torture/compile/20030224-1.c index 6832dc8..11bc3af 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20030224-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20030224-1.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target alloca } */ void zzz (char *s1, char *s2, int len, int *q) { int z = 5; diff --git a/gcc/testsuite/gcc.c-torture/compile/20050801-2.c b/gcc/testsuite/gcc.c-torture/compile/20050801-2.c index 45bd2a0..ba8daba 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20050801-2.c +++ b/gcc/testsuite/gcc.c-torture/compile/20050801-2.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ __inline int f(int i) { struct { diff --git a/gcc/testsuite/gcc.c-torture/compile/20071108-1.c b/gcc/testsuite/gcc.c-torture/compile/20071108-1.c index b9a36ef..25e71bf 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20071108-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20071108-1.c @@ -1,4 +1,5 @@ /* PR tree-optimization/33680 */ +/* { dg-require-effective-target alloca } */ int f (int dim, int *b, int *c) diff --git a/gcc/testsuite/gcc.c-torture/compile/20071117-1.c b/gcc/testsuite/gcc.c-torture/compile/20071117-1.c index efcd512..43bc098 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20071117-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20071117-1.c @@ -1,4 +1,5 @@ /* PR middle-end/34134 */ +/* { dg-require-effective-target alloca } */ extern void bar (void *, int); diff --git a/gcc/testsuite/gcc.c-torture/compile/900313-1.c b/gcc/testsuite/gcc.c-torture/compile/900313-1.c index f2bc40d..2bac581 100644 --- a/gcc/testsuite/gcc.c-torture/compile/900313-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/900313-1.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target alloca } */ main () { char *a; diff --git a/gcc/testsuite/gcc.c-torture/compile/920428-4.c b/gcc/testsuite/gcc.c-torture/compile/920428-4.c index cc5e30c..293c466 100644 --- a/gcc/testsuite/gcc.c-torture/compile/920428-4.c +++ b/gcc/testsuite/gcc.c-torture/compile/920428-4.c @@ -1 +1,2 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ x(a){struct{int p[a],i;}l;l.i;} diff --git a/gcc/testsuite/gcc.c-torture/compile/debugvlafunction-1.c b/gcc/testsuite/gcc.c-torture/compile/debugvlafunction-1.c index 3911f87..14bf579 100644 --- a/gcc/testsuite/gcc.c-torture/compile/debugvlafunction-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/debugvlafunction-1.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ extern void dynreplace_trampoline(void); extern void dynreplace_trampoline_endlabel(void); int dynreplace_add_trampoline(void) diff --git a/gcc/testsuite/gcc.c-torture/compile/parms.c b/gcc/testsuite/gcc.c-torture/compile/parms.c index 26c2c70..8205a9c 100644 --- a/gcc/testsuite/gcc.c-torture/compile/parms.c +++ b/gcc/testsuite/gcc.c-torture/compile/parms.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target alloca } */ #define alloca __builtin_alloca x (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, x, y) diff --git a/gcc/testsuite/gcc.c-torture/compile/pr17397.c b/gcc/testsuite/gcc.c-torture/compile/pr17397.c index b857472..6dde3c8 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr17397.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr17397.c @@ -1,4 +1,5 @@ /* ICE due to invalid GIMPLE created during strlen simplification. */ +/* { dg-require-effective-target alloca } */ extern unsigned long strlen (__const char *__s); extern void bar (); diff --git a/gcc/testsuite/gcc.c-torture/compile/pr35006.c b/gcc/testsuite/gcc.c-torture/compile/pr35006.c index 53de05c..fc343da 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr35006.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr35006.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target alloca } */ typedef unsigned long grub_uint64_t; typedef grub_uint64_t grub_size_t; grub_cmdline_get (unsigned max_len, int echo_char) diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41469.c b/gcc/testsuite/gcc.c-torture/compile/pr41469.c index b89ee63..5917794 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr41469.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr41469.c @@ -1,4 +1,5 @@ /* { dg-options "-fexceptions" } */ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ void af (void *a) diff --git a/gcc/testsuite/gcc.c-torture/compile/pr42956.c b/gcc/testsuite/gcc.c-torture/compile/pr42956.c index f592d4b..ce03a8f 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr42956.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr42956.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target alloca } */ typedef const int cint; typedef struct { } Bounds; diff --git a/gcc/testsuite/gcc.c-torture/compile/pr51354.c b/gcc/testsuite/gcc.c-torture/compile/pr51354.c index 5b2abb0..354f40e 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr51354.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr51354.c @@ -1,4 +1,5 @@ /* PR target/51354 */ +/* { dg-require-effective-target alloca } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.c-torture/compile/pr52714.c b/gcc/testsuite/gcc.c-torture/compile/pr52714.c index 03d4990..38a4ab5 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr52714.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr52714.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target alloca } */ int __re_compile_fastmap(unsigned char *p) { diff --git a/gcc/testsuite/gcc.c-torture/compile/pr55851.c b/gcc/testsuite/gcc.c-torture/compile/pr55851.c index 6198a73..8d118b8 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr55851.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr55851.c @@ -1,4 +1,5 @@ /* PR middle-end/55851 */ +/* { dg-require-effective-target alloca } */ enum { A = 1UL, B = -1UL } var = A; void foo (char *); diff --git a/gcc/testsuite/gcc.c-torture/compile/vla-const-1.c b/gcc/testsuite/gcc.c-torture/compile/vla-const-1.c index 6acc3d8..c7c1dbe 100644 --- a/gcc/testsuite/gcc.c-torture/compile/vla-const-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/vla-const-1.c @@ -1,5 +1,6 @@ /* Test TREE_CONSTANT VLA size: bug 27893. */ /* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-require-effective-target alloca } */ int a; void g(void *); void f(void) { int b[(__SIZE_TYPE__)&a]; g(b); } diff --git a/gcc/testsuite/gcc.c-torture/compile/vla-const-2.c b/gcc/testsuite/gcc.c-torture/compile/vla-const-2.c index 913a730..5bbd9b5 100644 --- a/gcc/testsuite/gcc.c-torture/compile/vla-const-2.c +++ b/gcc/testsuite/gcc.c-torture/compile/vla-const-2.c @@ -1,4 +1,5 @@ /* Test TREE_CONSTANT VLA size: bug 27893. */ /* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-require-effective-target alloca } */ void g(void *); void f(void) { int b[1/0]; g(b); } diff --git a/gcc/testsuite/gcc.c-torture/execute/20010209-1.c b/gcc/testsuite/gcc.c-torture/execute/20010209-1.c index e04d605..1df7332 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20010209-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20010209-1.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target alloca } */ int b; int foo (void) { diff --git a/gcc/testsuite/gcc.c-torture/execute/20020314-1.c b/gcc/testsuite/gcc.c-torture/execute/20020314-1.c index 28288c8..2f68ae8 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20020314-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20020314-1.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target alloca } */ void f(void * a, double y) { } diff --git a/gcc/testsuite/gcc.c-torture/execute/20020412-1.c b/gcc/testsuite/gcc.c-torture/execute/20020412-1.c index df0efe0..58205d2 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20020412-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20020412-1.c @@ -1,6 +1,7 @@ /* PR c/3711 This testcase ICEd on IA-32 at -O0 and was miscompiled otherwise, because std_expand_builtin_va_arg didn't handle variable size types. */ +/* { dg-require-effective-target alloca } */ #include <stdarg.h> diff --git a/gcc/testsuite/gcc.c-torture/execute/20021113-1.c b/gcc/testsuite/gcc.c-torture/execute/20021113-1.c index 420926d..8226d3a 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20021113-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20021113-1.c @@ -1,3 +1,5 @@ +/* { dg-require-effective-target alloca } */ + /* This program tests a data flow bug that would cause constant propagation to propagate constants through function calls. */ diff --git a/gcc/testsuite/gcc.c-torture/execute/20040223-1.c b/gcc/testsuite/gcc.c-torture/execute/20040223-1.c index 940ec0d..c295e4b 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20040223-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20040223-1.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target alloca } */ #include <string.h> #include <stdio.h> diff --git a/gcc/testsuite/gcc.c-torture/execute/20040308-1.c b/gcc/testsuite/gcc.c-torture/execute/20040308-1.c index 4c63535..4277a50 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20040308-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20040308-1.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target alloca } */ /* This used to fail on SPARC with an unaligned memory access. */ void foo(int n) diff --git a/gcc/testsuite/gcc.c-torture/execute/20040811-1.c b/gcc/testsuite/gcc.c-torture/execute/20040811-1.c index 0122825..f7a4de9 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20040811-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20040811-1.c @@ -1,4 +1,5 @@ /* { dg-require-effective-target int32plus } */ +/* { dg-require-effective-target alloca } */ /* Ensure that we deallocate X when branching back before its declaration. */ diff --git a/gcc/testsuite/gcc.c-torture/execute/20070824-1.c b/gcc/testsuite/gcc.c-torture/execute/20070824-1.c index 74eb58c..4842bfe 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20070824-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20070824-1.c @@ -1,4 +1,5 @@ /* PR tree-optimization/33136 */ +/* { dg-require-effective-target alloca } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.c-torture/execute/20070919-1.c b/gcc/testsuite/gcc.c-torture/execute/20070919-1.c index ade3d7e..d3e7693 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20070919-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20070919-1.c @@ -1,4 +1,5 @@ /* PR c/33238 */ +/* { dg-require-effective-target alloca } */ typedef __SIZE_TYPE__ size_t; int memcmp (const void *, const void *, size_t); diff --git a/gcc/testsuite/gcc.c-torture/execute/920721-2.c b/gcc/testsuite/gcc.c-torture/execute/920721-2.c index ed4e0bf..cfad0e9 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920721-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/920721-2.c @@ -1,2 +1,3 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ f(){} main(){int n=2;double x[n];f();exit(0);} diff --git a/gcc/testsuite/gcc.c-torture/execute/920929-1.c b/gcc/testsuite/gcc.c-torture/execute/920929-1.c index e43444e..061617d 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920929-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/920929-1.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ /* REPRODUCED:RUN:SIGNAL MACHINE:sparc OPTIONS: */ f(int n) { diff --git a/gcc/testsuite/gcc.c-torture/execute/921017-1.c b/gcc/testsuite/gcc.c-torture/execute/921017-1.c index ab68fc0..c7fab58 100644 --- a/gcc/testsuite/gcc.c-torture/execute/921017-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/921017-1.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ f(n) { int a[n]; diff --git a/gcc/testsuite/gcc.c-torture/execute/941202-1.c b/gcc/testsuite/gcc.c-torture/execute/941202-1.c index 72d0b33..b97ae0e 100644 --- a/gcc/testsuite/gcc.c-torture/execute/941202-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/941202-1.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ g (x, y) { if (x != 3) diff --git a/gcc/testsuite/gcc.c-torture/execute/align-nest.c b/gcc/testsuite/gcc.c-torture/execute/align-nest.c index 2ff2952..5298b09 100644 --- a/gcc/testsuite/gcc.c-torture/execute/align-nest.c +++ b/gcc/testsuite/gcc.c-torture/execute/align-nest.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ void foo(int n) { diff --git a/gcc/testsuite/gcc.c-torture/execute/alloca-1.c b/gcc/testsuite/gcc.c-torture/execute/alloca-1.c index a8d1384..6a65ddf 100644 --- a/gcc/testsuite/gcc.c-torture/execute/alloca-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/alloca-1.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ /* Verify that alloca storage is sufficiently aligned. */ /* ??? May fail if BIGGEST_ALIGNMENT > STACK_BOUNDARY. Which, I guess can only happen on !STRICT_ALIGNMENT targets. */ diff --git a/gcc/testsuite/gcc.c-torture/execute/built-in-setjmp.c b/gcc/testsuite/gcc.c-torture/execute/built-in-setjmp.c index 9da7878..4370c3d 100644 --- a/gcc/testsuite/gcc.c-torture/execute/built-in-setjmp.c +++ b/gcc/testsuite/gcc.c-torture/execute/built-in-setjmp.c @@ -1,3 +1,5 @@ +/* { dg-require-effective-target alloca } */ + extern int strcmp(const char *, const char *); extern char *strcpy(char *, const char *); extern void abort(void); diff --git a/gcc/testsuite/gcc.c-torture/execute/pr22061-1.c b/gcc/testsuite/gcc.c-torture/execute/pr22061-1.c index 65375fe..ffd6ccc 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr22061-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr22061-1.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target alloca } */ int N = 1; void foo() {} /* Necessary to trigger the original ICE. */ void bar (char a[2][N]) { a[1][0] = N; } diff --git a/gcc/testsuite/gcc.c-torture/execute/pr22061-4.c b/gcc/testsuite/gcc.c-torture/execute/pr22061-4.c index 38ce3e8..f7c89e6 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr22061-4.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr22061-4.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ void bar (int N) { diff --git a/gcc/testsuite/gcc.c-torture/execute/pr36321.c b/gcc/testsuite/gcc.c-torture/execute/pr36321.c index 1edf8e4..4af993d 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr36321.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr36321.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ extern void abort (void); extern __SIZE_TYPE__ strlen (const char *); diff --git a/gcc/testsuite/gcc.c-torture/execute/pr43220.c b/gcc/testsuite/gcc.c-torture/execute/pr43220.c index 0d6ebfb..d61dfe8 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr43220.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr43220.c @@ -1,4 +1,5 @@ /* { dg-require-effective-target int32plus } */ +/* { dg-require-effective-target alloca } */ void *volatile p; diff --git a/gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c b/gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c index 9eb95c1..3b74b85 100644 --- a/gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c @@ -1,5 +1,6 @@ /* VLAs should be deallocated on a jump to before their definition, including a jump to a label in an inner scope. PR 19771. */ +/* { dg-require-effective-target alloca } */ #if (__SIZEOF_INT__ <= 2) #define LIMIT 10000 diff --git a/gcc/testsuite/gcc.dg/20001012-2.c b/gcc/testsuite/gcc.dg/20001012-2.c index 629ae1b..e7a4fb8 100644 --- a/gcc/testsuite/gcc.dg/20001012-2.c +++ b/gcc/testsuite/gcc.dg/20001012-2.c @@ -1,5 +1,6 @@ /* { dg-do run { target fpic } } */ /* { dg-options "-O2 -fpic" } */ +/* { dg-require-effective-target alloca } */ extern void abort (void); extern void exit (int); diff --git a/gcc/testsuite/gcc.dg/auto-type-1.c b/gcc/testsuite/gcc.dg/auto-type-1.c index f47693a..882bf2c 100644 --- a/gcc/testsuite/gcc.dg/auto-type-1.c +++ b/gcc/testsuite/gcc.dg/auto-type-1.c @@ -1,6 +1,7 @@ /* Test __auto_type. Test correct uses. */ /* { dg-do run } */ /* { dg-options "" } */ +/* { dg-require-effective-target alloca } */ extern void abort (void); extern void exit (int); diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-1.c b/gcc/testsuite/gcc.dg/builtin-object-size-1.c index 13ebeb1..264ef75 100644 --- a/gcc/testsuite/gcc.dg/builtin-object-size-1.c +++ b/gcc/testsuite/gcc.dg/builtin-object-size-1.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2" } */ +/* { dg-require-effective-target alloca } */ typedef __SIZE_TYPE__ size_t; extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-2.c b/gcc/testsuite/gcc.dg/builtin-object-size-2.c index 21aff5a..ad2dd29 100644 --- a/gcc/testsuite/gcc.dg/builtin-object-size-2.c +++ b/gcc/testsuite/gcc.dg/builtin-object-size-2.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2" } */ +/* { dg-require-effective-target alloca } */ typedef __SIZE_TYPE__ size_t; extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-3.c b/gcc/testsuite/gcc.dg/builtin-object-size-3.c index 572ecda..d5ca504 100644 --- a/gcc/testsuite/gcc.dg/builtin-object-size-3.c +++ b/gcc/testsuite/gcc.dg/builtin-object-size-3.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2" } */ +/* { dg-require-effective-target alloca } */ typedef __SIZE_TYPE__ size_t; extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-4.c b/gcc/testsuite/gcc.dg/builtin-object-size-4.c index 1eb30d1..c22654d 100644 --- a/gcc/testsuite/gcc.dg/builtin-object-size-4.c +++ b/gcc/testsuite/gcc.dg/builtin-object-size-4.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2" } */ +/* { dg-require-effective-target alloca } */ typedef __SIZE_TYPE__ size_t; extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/packed-vla.c b/gcc/testsuite/gcc.dg/packed-vla.c index 04ccb96..e673b72 100644 --- a/gcc/testsuite/gcc.dg/packed-vla.c +++ b/gcc/testsuite/gcc.dg/packed-vla.c @@ -1,6 +1,7 @@ /* PR middle-end/27945 */ /* { dg-do run } */ /* { dg-options "" } */ +/* { dg-require-effective-target alloca } */ extern int printf (const char *, ...); extern void abort (); diff --git a/gcc/testsuite/gcc.dg/pr31507-1.c b/gcc/testsuite/gcc.dg/pr31507-1.c index dbba1e1..f6a7e74 100644 --- a/gcc/testsuite/gcc.dg/pr31507-1.c +++ b/gcc/testsuite/gcc.dg/pr31507-1.c @@ -1,6 +1,7 @@ /* PR target/31507 */ /* { dg-do run } */ /* { dg-options "-Os -fno-omit-frame-pointer" } */ +/* { dg-require-effective-target alloca } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/torture/pr48953.c b/gcc/testsuite/gcc.dg/torture/pr48953.c index 41a3d7b..e5c8d67 100644 --- a/gcc/testsuite/gcc.dg/torture/pr48953.c +++ b/gcc/testsuite/gcc.dg/torture/pr48953.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-fno-tree-dce" } */ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ static inline int foo (int n, int k) { diff --git a/gcc/testsuite/gcc.dg/torture/pr8081.c b/gcc/testsuite/gcc.dg/torture/pr8081.c index 008ec5a..0046655 100644 --- a/gcc/testsuite/gcc.dg/torture/pr8081.c +++ b/gcc/testsuite/gcc.dg/torture/pr8081.c @@ -1,4 +1,5 @@ /* { dg-do run } */ +/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ extern void abort (void); int diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c index e226e7f..6a35c9d 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-require-effective-target alloca } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/global-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/global-1.c index 332103a..91983f5 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/global-1.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/global-1.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c index 38127fd..9f3db03 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c index 85a2ee3..f838435 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-require-effective-target alloca } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c index 8402f95..ea53330 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c index dabc310..ecfdcb0 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c index 917bdc3..631cc92 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-require-effective-target alloca } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c b/gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c index 05cb833..0e94d2c 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c index b917e82..0eef809 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c index 9a039eb..ee3dd74 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c @@ -1,4 +1,5 @@ /* { dg-do run } */ +/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c index 1c1ddd1..dc5abf2 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c @@ -1,4 +1,5 @@ /* { dg-do run } */ +/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c index b218a14..bb1b4a1 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c index 8602132..d0420ae 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */ #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c index 5b36f2c..22d4f77 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-require-effective-target alloca } */ #include <stdarg.h> #include "check.h" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c index 6740e99..c678b51 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */ +/* { dg-require-effective-target alloca } */ #include <stdarg.h> #include "check.h" diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 5e5338d..b6e2dde 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -599,6 +599,15 @@ proc add_options_for_tls { flags } { return $flags } +# Return 1 if alloca is supported, 0 otherwise. + +proc check_effective_target_alloca {} { + if { [istarget nvptx-*-*] } { + return 0 + } + return 1 +} + # Return 1 if thread local storage (TLS) is supported, 0 otherwise. proc check_effective_target_tls {} { |