diff mbox

[1/6] nvptx testsuite patches: alloca

Message ID 544669C8.1050201@codesourcery.com
State New
Headers show

Commit Message

Bernd Schmidt Oct. 21, 2014, 2:12 p.m. UTC
This deals with uses of alloca in the testsuite. Some tests require it 
outright, others only at -O0, and others require it implicitly by 
requiring an alignment for stack variables bigger than the target's 
STACK_BOUNDARY. For the latter I've added explicit xfails.


Bernd

Comments

Jeff Law Oct. 21, 2014, 3:13 p.m. UTC | #1
On 10/21/14 14:12, Bernd Schmidt wrote:
> This deals with uses of alloca in the testsuite. Some tests require it
> outright, others only at -O0, and others require it implicitly by
> requiring an alignment for stack variables bigger than the target's
> STACK_BOUNDARY. For the latter I've added explicit xfails.
OK.
Jeff
diff mbox

Patch

	gcc/testsuite/
	* 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.

------------------------------------------------------------------------
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp.orig
+++ gcc/testsuite/lib/target-supports.exp
@@ -604,6 +606,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 {} {
Index: gcc/testsuite/gcc.c-torture/execute/20010209-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/20010209-1.c.orig
+++ gcc/testsuite/gcc.c-torture/execute/20010209-1.c
@@ -1,3 +1,4 @@ 
+/* { dg-require-effective-target alloca } */
 int b;
 int foo (void)
 {
Index: gcc/testsuite/gcc.c-torture/execute/20020314-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/20020314-1.c.orig
+++ gcc/testsuite/gcc.c-torture/execute/20020314-1.c
@@ -1,3 +1,4 @@ 
+/* { dg-require-effective-target alloca } */
 void f(void * a, double y)
 {
 }
Index: gcc/testsuite/gcc.c-torture/execute/20020412-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/20020412-1.c.orig
+++ 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>
 
Index: gcc/testsuite/gcc.c-torture/execute/20021113-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/20021113-1.c.orig
+++ 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.  */
 
Index: gcc/testsuite/gcc.c-torture/execute/20040223-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/20040223-1.c.orig
+++ gcc/testsuite/gcc.c-torture/execute/20040223-1.c
@@ -1,3 +1,4 @@ 
+/* { dg-require-effective-target alloca } */
 #include <string.h>
 #include <stdio.h>
 
Index: gcc/testsuite/gcc.c-torture/execute/20040308-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/20040308-1.c.orig
+++ 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)
Index: gcc/testsuite/gcc.c-torture/execute/20040811-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/20040811-1.c.orig
+++ 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.  */
Index: gcc/testsuite/gcc.c-torture/execute/20070824-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/20070824-1.c.orig
+++ 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);
 
Index: gcc/testsuite/gcc.c-torture/execute/20070919-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/20070919-1.c.orig
+++ 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);
Index: gcc/testsuite/gcc.c-torture/execute/920721-2.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/920721-2.c.orig
+++ 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);}
Index: gcc/testsuite/gcc.c-torture/execute/920929-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/920929-1.c.orig
+++ 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)
 {
Index: gcc/testsuite/gcc.c-torture/execute/921017-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/921017-1.c.orig
+++ 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];
Index: gcc/testsuite/gcc.c-torture/execute/941202-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/941202-1.c.orig
+++ 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)
Index: gcc/testsuite/gcc.c-torture/execute/align-nest.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/align-nest.c.orig
+++ gcc/testsuite/gcc.c-torture/execute/align-nest.c
@@ -1,3 +1,4 @@ 
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
 
 void foo(int n)
 {
Index: gcc/testsuite/gcc.c-torture/execute/alloca-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/alloca-1.c.orig
+++ 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.  */
Index: gcc/testsuite/gcc.c-torture/execute/built-in-setjmp.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/built-in-setjmp.c.orig
+++ 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);
Index: gcc/testsuite/gcc.c-torture/execute/pr22061-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/pr22061-1.c.orig
+++ 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; }
Index: gcc/testsuite/gcc.c-torture/execute/pr22061-4.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/pr22061-4.c.orig
+++ gcc/testsuite/gcc.c-torture/execute/pr22061-4.c
@@ -1,3 +1,4 @@ 
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
 void
 bar (int N)
 {
Index: gcc/testsuite/gcc.c-torture/execute/pr36321.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/pr36321.c.orig
+++ 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 *);
Index: gcc/testsuite/gcc.c-torture/execute/pr43220.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/pr43220.c.orig
+++ 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;
 
Index: gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c.orig
+++ 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
Index: gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c.orig
+++ 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"
Index: gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c.orig
+++ 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"
Index: gcc/testsuite/gcc.c-torture/compile/20000923-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/20000923-1.c.orig
+++ 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;
 
Index: gcc/testsuite/gcc.c-torture/compile/20001221-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/20001221-1.c.orig
+++ gcc/testsuite/gcc.c-torture/compile/20001221-1.c
@@ -1,3 +1,4 @@ 
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
 static void
 foo ()
 {
Index: gcc/testsuite/gcc.c-torture/compile/20020807-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/20020807-1.c.orig
+++ gcc/testsuite/gcc.c-torture/compile/20020807-1.c
@@ -1,3 +1,4 @@ 
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
 int x;
 
 static int
Index: gcc/testsuite/gcc.c-torture/compile/20030224-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/20030224-1.c.orig
+++ 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;
Index: gcc/testsuite/gcc.c-torture/compile/20050801-2.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/20050801-2.c.orig
+++ 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 {
Index: gcc/testsuite/gcc.c-torture/compile/20071108-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/20071108-1.c.orig
+++ 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)
Index: gcc/testsuite/gcc.c-torture/compile/20071117-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/20071117-1.c.orig
+++ 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);
 
Index: gcc/testsuite/gcc.c-torture/compile/900313-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/900313-1.c.orig
+++ gcc/testsuite/gcc.c-torture/compile/900313-1.c
@@ -1,3 +1,4 @@ 
+/* { dg-require-effective-target alloca } */
 main ()
 {
   char *a;
Index: gcc/testsuite/gcc.c-torture/compile/920428-4.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/920428-4.c.orig
+++ gcc/testsuite/gcc.c-torture/compile/920428-4.c
@@ -1,1 +1,2 @@ 
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
 x(a){struct{int p[a],i;}l;l.i;}
Index: gcc/testsuite/gcc.c-torture/compile/debugvlafunction-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/debugvlafunction-1.c.orig
+++ 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)
Index: gcc/testsuite/gcc.c-torture/compile/pr17397.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr17397.c.orig
+++ 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 ();
Index: gcc/testsuite/gcc.c-torture/compile/pr35006.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr35006.c.orig
+++ 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)
Index: gcc/testsuite/gcc.c-torture/compile/pr41469.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr41469.c.orig
+++ 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)
Index: gcc/testsuite/gcc.c-torture/compile/pr42956.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr42956.c.orig
+++ gcc/testsuite/gcc.c-torture/compile/pr42956.c
@@ -1,3 +1,4 @@ 
+/* { dg-require-effective-target alloca } */
 typedef const int cint;
 typedef struct {
 } Bounds;
Index: gcc/testsuite/gcc.c-torture/compile/pr51354.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr51354.c.orig
+++ gcc/testsuite/gcc.c-torture/compile/pr51354.c
@@ -1,4 +1,5 @@ 
 /* PR target/51354 */
+/* { dg-require-effective-target alloca } */
 
 extern void abort (void);
 
Index: gcc/testsuite/gcc.c-torture/compile/pr55851.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr55851.c.orig
+++ 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 *);
Index: gcc/testsuite/gcc.c-torture/compile/vla-const-2.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/vla-const-2.c.orig
+++ 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); }
Index: gcc/testsuite/gcc.dg/pr31507-1.c
===================================================================
--- gcc/testsuite/gcc.dg/pr31507-1.c.orig
+++ 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);
 
Index: gcc/testsuite/gcc.c-torture/compile/pr52714.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr52714.c.orig
+++ gcc/testsuite/gcc.c-torture/compile/pr52714.c
@@ -1,3 +1,4 @@ 
+/* { dg-require-effective-target alloca } */
 
 int __re_compile_fastmap(unsigned char *p)
 {
Index: gcc/testsuite/gcc.c-torture/compile/vla-const-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/vla-const-1.c.orig
+++ 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); }
Index: gcc/testsuite/gcc.dg/20001012-2.c
===================================================================
--- gcc/testsuite/gcc.dg/20001012-2.c.orig
+++ 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);
Index: gcc/testsuite/gcc.dg/auto-type-1.c
===================================================================
--- gcc/testsuite/gcc.dg/auto-type-1.c.orig
+++ 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);
Index: gcc/testsuite/gcc.dg/builtin-object-size-1.c
===================================================================
--- gcc/testsuite/gcc.dg/builtin-object-size-1.c.orig
+++ 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);
Index: gcc/testsuite/gcc.dg/builtin-object-size-2.c
===================================================================
--- gcc/testsuite/gcc.dg/builtin-object-size-2.c.orig
+++ 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);
Index: gcc/testsuite/gcc.dg/builtin-object-size-3.c
===================================================================
--- gcc/testsuite/gcc.dg/builtin-object-size-3.c.orig
+++ 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);
Index: gcc/testsuite/gcc.dg/builtin-object-size-4.c
===================================================================
--- gcc/testsuite/gcc.dg/builtin-object-size-4.c.orig
+++ 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);
Index: gcc/testsuite/gcc.dg/packed-vla.c
===================================================================
--- gcc/testsuite/gcc.dg/packed-vla.c.orig
+++ 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 ();
Index: gcc/testsuite/gcc.dg/torture/pr48953.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr48953.c.orig
+++ 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)
 {
Index: gcc/testsuite/gcc.dg/torture/pr8081.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr8081.c.orig
+++ 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
Index: gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/global-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/global-1.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c.orig
+++ 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"
 
Index: gcc/testsuite/gcc.c-torture/compile/parms.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/parms.c.orig
+++ 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)