Commit 41287945 by Tom de Vries Committed by Tom de Vries

Add dg-require-effective-target alloca for c++ test-cases

2018-01-12  Tom de Vries  <tom@codesourcery.com>

	* c-c++-common/dwarf2/vla1.c: Add dg-require-effective-target alloca.
	* g++.dg/Walloca1.C: Same.
	* g++.dg/cpp0x/pr70338.C: Same.
	* g++.dg/cpp1y/lambda-generic-vla1.C: Same.
	* g++.dg/cpp1y/vla10.C: Same.
	* g++.dg/cpp1y/vla2.C: Same.
	* g++.dg/cpp1y/vla6.C: Same.
	* g++.dg/cpp1y/vla8.C: Same.
	* g++.dg/debug/debug5.C: Same.
	* g++.dg/debug/debug6.C: Same.
	* g++.dg/debug/pr54828.C: Same.
	* g++.dg/diagnostic/pr70105.C: Same.
	* g++.dg/eh/cleanup5.C: Same.
	* g++.dg/eh/spbp.C: Same.
	* g++.dg/ext/tmplattr9.C: Same.
	* g++.dg/ext/vla10.C: Same.
	* g++.dg/ext/vla11.C: Same.
	* g++.dg/ext/vla12.C: Same.
	* g++.dg/ext/vla15.C: Same.
	* g++.dg/ext/vla16.C: Same.
	* g++.dg/ext/vla17.C: Same.
	* g++.dg/ext/vla3.C: Same.
	* g++.dg/ext/vla6.C: Same.
	* g++.dg/ext/vla7.C: Same.
	* g++.dg/init/array24.C: Same.
	* g++.dg/init/new47.C: Same.
	* g++.dg/init/pr55497.C: Same.
	* g++.dg/opt/pr78201.C: Same.
	* g++.dg/template/vla2.C: Same.
	* g++.dg/torture/Wsizeof-pointer-memaccess1.C: Same.
	* g++.dg/torture/Wsizeof-pointer-memaccess2.C: Same.
	* g++.dg/torture/pr62127.C: Same.
	* g++.dg/torture/pr67055.C: Same.
	* g++.dg/torture/stackalign/eh-alloca-1.C: Same.
	* g++.dg/torture/stackalign/eh-inline-2.C: Same.
	* g++.dg/torture/stackalign/eh-vararg-1.C: Same.
	* g++.dg/torture/stackalign/eh-vararg-2.C: Same.
	* g++.dg/warn/Wplacement-new-size-5.C: Same.
	* g++.dg/warn/Wsizeof-pointer-memaccess-1.C: Same.
	* g++.dg/warn/Wvla-1.C: Same.
	* g++.dg/warn/Wvla-3.C: Same.
	* g++.old-deja/g++.ext/array2.C: Same.
	* g++.old-deja/g++.ext/constructor.C: Same.
	* g++.old-deja/g++.law/builtin1.C: Same.
	* g++.old-deja/g++.other/crash12.C: Same.
	* g++.old-deja/g++.other/eh3.C: Same.
	* g++.old-deja/g++.pt/array6.C: Same.
	* g++.old-deja/g++.pt/dynarray.C: Same.

From-SVN: r256570
parent 01da712b
2018-01-12 Tom de Vries <tom@codesourcery.com>
* c-c++-common/dwarf2/vla1.c: Add dg-require-effective-target alloca.
* g++.dg/Walloca1.C: Same.
* g++.dg/cpp0x/pr70338.C: Same.
* g++.dg/cpp1y/lambda-generic-vla1.C: Same.
* g++.dg/cpp1y/vla10.C: Same.
* g++.dg/cpp1y/vla2.C: Same.
* g++.dg/cpp1y/vla6.C: Same.
* g++.dg/cpp1y/vla8.C: Same.
* g++.dg/debug/debug5.C: Same.
* g++.dg/debug/debug6.C: Same.
* g++.dg/debug/pr54828.C: Same.
* g++.dg/diagnostic/pr70105.C: Same.
* g++.dg/eh/cleanup5.C: Same.
* g++.dg/eh/spbp.C: Same.
* g++.dg/ext/tmplattr9.C: Same.
* g++.dg/ext/vla10.C: Same.
* g++.dg/ext/vla11.C: Same.
* g++.dg/ext/vla12.C: Same.
* g++.dg/ext/vla15.C: Same.
* g++.dg/ext/vla16.C: Same.
* g++.dg/ext/vla17.C: Same.
* g++.dg/ext/vla3.C: Same.
* g++.dg/ext/vla6.C: Same.
* g++.dg/ext/vla7.C: Same.
* g++.dg/init/array24.C: Same.
* g++.dg/init/new47.C: Same.
* g++.dg/init/pr55497.C: Same.
* g++.dg/opt/pr78201.C: Same.
* g++.dg/template/vla2.C: Same.
* g++.dg/torture/Wsizeof-pointer-memaccess1.C: Same.
* g++.dg/torture/Wsizeof-pointer-memaccess2.C: Same.
* g++.dg/torture/pr62127.C: Same.
* g++.dg/torture/pr67055.C: Same.
* g++.dg/torture/stackalign/eh-alloca-1.C: Same.
* g++.dg/torture/stackalign/eh-inline-2.C: Same.
* g++.dg/torture/stackalign/eh-vararg-1.C: Same.
* g++.dg/torture/stackalign/eh-vararg-2.C: Same.
* g++.dg/warn/Wplacement-new-size-5.C: Same.
* g++.dg/warn/Wsizeof-pointer-memaccess-1.C: Same.
* g++.dg/warn/Wvla-1.C: Same.
* g++.dg/warn/Wvla-3.C: Same.
* g++.old-deja/g++.ext/array2.C: Same.
* g++.old-deja/g++.ext/constructor.C: Same.
* g++.old-deja/g++.law/builtin1.C: Same.
* g++.old-deja/g++.other/crash12.C: Same.
* g++.old-deja/g++.other/eh3.C: Same.
* g++.old-deja/g++.pt/array6.C: Same.
* g++.old-deja/g++.pt/dynarray.C: Same.
2018-01-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2018-01-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* g++.dg/cpp0x/inh-ctor30.C: Allow for alternate mangled form. * g++.dg/cpp0x/inh-ctor30.C: Allow for alternate mangled form.
......
// PR debug/42800 // PR debug/42800
// { dg-options "-gdwarf-2 -dA" } // { dg-options "-gdwarf-2 -dA" }
// { dg-final { scan-assembler "DW_AT_upper_bound" } } // { dg-final { scan-assembler "DW_AT_upper_bound" } }
// { dg-require-effective-target alloca }
int int
f (int i) f (int i)
......
/* PR middle-end/79809 */ /* PR middle-end/79809 */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-Walloca-larger-than=4207115063 -Wvla-larger-than=1233877270 -O2" } */ /* { dg-options "-Walloca-larger-than=4207115063 -Wvla-larger-than=1233877270 -O2" } */
/* { dg-require-effective-target alloca } */
int a; int a;
char *b = static_cast<char *>(__builtin_alloca (a)); // { dg-warning "argument to .alloca. may be too large|unbounded use of" } char *b = static_cast<char *>(__builtin_alloca (a)); // { dg-warning "argument to .alloca. may be too large|unbounded use of" }
// PR c++/70338 // PR c++/70338
// { dg-do compile { target c++11 } } // { dg-do compile { target c++11 } }
// { dg-options "-g" } // { dg-options "-g" }
// { dg-require-effective-target alloca }
template<typename T> template<typename T>
void void
......
// PR c++/59271 // PR c++/59271
// { dg-do compile { target c++14 } } // { dg-do compile { target c++14 } }
// { dg-options "-Wno-vla" } // { dg-options "-Wno-vla" }
// { dg-require-effective-target alloca }
extern "C" int printf (const char *, ...); extern "C" int printf (const char *, ...);
......
// PR c++/57402 // PR c++/57402
// { dg-do run } // { dg-do run }
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
int i = 2; int i = 2;
......
// N3639 allows initialization and capture of VLAs // N3639 allows initialization and capture of VLAs
// { dg-do run { target c++11 } } // { dg-do run { target c++11 } }
// { dg-options "-Wno-vla" } // { dg-options "-Wno-vla" }
// { dg-require-effective-target alloca }
void f(int n) void f(int n)
{ {
......
// PR c++/57404 // PR c++/57404
// { dg-do compile { target c++11 } } // { dg-do compile { target c++11 } }
// { dg-options "-g" } // { dg-options "-g" }
// { dg-require-effective-target alloca }
void f (int i) void f (int i)
{ {
......
// PR c++/55149 // PR c++/55149
// { dg-do compile { target c++11 } } // { dg-do compile { target c++11 } }
// { dg-options "-Wno-vla" } // { dg-options "-Wno-vla" }
// { dg-require-effective-target alloca }
template<unsigned int TA> template<unsigned int TA>
struct SA struct SA
......
// { dg-do compile } // { dg-do compile }
// { dg-require-effective-target alloca }
int foo() int foo()
{ {
......
// { dg-do compile } // { dg-do compile }
// { dg-require-effective-target alloca }
void foo() void foo()
{ {
......
// PR debug/54828 // PR debug/54828
// { dg-do compile } // { dg-do compile }
// { dg-options "-g" } // { dg-options "-g" }
// { dg-require-effective-target alloca }
struct T { T (); virtual ~T (); }; struct T { T (); virtual ~T (); };
struct S : public virtual T { S (); virtual ~S (); }; struct S : public virtual T { S (); virtual ~S (); };
......
// { dg-options "-Wsequence-point -fdiagnostics-show-caret" } // { dg-options "-Wsequence-point -fdiagnostics-show-caret" }
// { dg-require-effective-target alloca }
void *libiberty_concat_ptr; void *libiberty_concat_ptr;
extern unsigned long concat_length (const char *, ...); extern unsigned long concat_length (const char *, ...);
......
// PR 17907 // PR 17907
// { dg-do compile } // { dg-do compile }
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
// We lost a CLEANUP_POINT_EXPR, leading to a crash destroying temp of A. // We lost a CLEANUP_POINT_EXPR, leading to a crash destroying temp of A.
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-gdwarf-2" } */ /* { dg-options "-gdwarf-2" } */
/* { dg-skip-if "No Dwarf" { { *-*-aix* hppa*-*-hpux* } && { ! hppa*64*-*-* } } } */ /* { dg-skip-if "No Dwarf" { { *-*-aix* hppa*-*-hpux* } && { ! hppa*64*-*-* } } } */
/* { dg-require-effective-target alloca } */
/* This was a bug on x86-darwin, where the register numbering for SP /* This was a bug on x86-darwin, where the register numbering for SP
and BP was swapped (it's easy to do because on that port it's and BP was swapped (it's easy to do because on that port it's
......
// PR c++/34937, 34962 // PR c++/34937, 34962
// { dg-require-weak "" } // { dg-require-weak "" }
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
struct A struct A
{ {
......
// PR c++/48446 // PR c++/48446
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
template<typename T> template<typename T>
struct A struct A
......
// Test that auto works with VLAs. // Test that auto works with VLAs.
// { dg-do compile { target c++11 } } // { dg-do compile { target c++11 } }
// { dg-options "-Wno-vla" } // { dg-options "-Wno-vla" }
// { dg-require-effective-target alloca }
void bar(int n) void bar(int n)
{ {
......
// VLA sizeof test // VLA sizeof test
// { dg-do compile } // { dg-do compile }
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
int int
f1 (int i) f1 (int i)
......
// PR c++/44613 // PR c++/44613
// { dg-do run } // { dg-do run }
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
void *volatile p; void *volatile p;
......
// PR c++/72766 // PR c++/72766
// { dg-options "-Wno-vla" } // { dg-options "-Wno-vla" }
// { dg-require-effective-target alloca }
long fn1() { long fn1() {
const int a = fn1(); const int a = fn1();
......
// PR c++/69487 // PR c++/69487
// { dg-do run } // { dg-do run }
// { dg-options -Wno-vla } // { dg-options -Wno-vla }
// { dg-require-effective-target alloca }
int size = 6; int size = 6;
......
// PR c++/28903 // PR c++/28903
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
template <class> template <class>
struct View struct View
......
// PR c++/28879 // PR c++/28879
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
struct A struct A
{ {
......
// PR c++/40013 // PR c++/40013
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
template <class T> template <class T>
struct A struct A
......
// PR c++/29175 // PR c++/29175
// { dg-options "-Wno-vla" } // { dg-options "-Wno-vla" }
// { dg-require-effective-target alloca }
void foo(int i) void foo(int i)
{ {
......
// PR c++/70448 // PR c++/70448
// { dg-do compile } // { dg-do compile }
// { dg-options "-Wall" } // { dg-options "-Wall" }
// { dg-require-effective-target alloca }
typedef __typeof__ (sizeof 0) size_t; typedef __typeof__ (sizeof 0) size_t;
void *operator new (size_t, void *p) { return p; } void *operator new (size_t, void *p) { return p; }
......
// PR c++/55497 // PR c++/55497
// { dg-options "-g" } // { dg-options "-g" }
// { dg-require-effective-target alloca }
int get(); int get();
......
// PR middle-end/78201 // PR middle-end/78201
// { dg-do compile } // { dg-do compile }
// { dg-options "-O2" } // { dg-options "-O2" }
// { dg-require-effective-target alloca }
struct B { long d (); } *c; struct B { long d (); } *c;
long e; long e;
......
// PR c++/28879 // PR c++/28879
// { dg-do compile } // { dg-do compile }
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
struct A struct A
{ {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
// Test just twice, once with -O0 non-fortified, once with -O2 fortified. // Test just twice, once with -O0 non-fortified, once with -O2 fortified.
// { dg-skip-if "" { *-*-* } { "*" } { "-O0" "-O2" } } // { dg-skip-if "" { *-*-* } { "*" } { "-O0" "-O2" } }
// { dg-skip-if "" { *-*-* } { "-flto" } { "" } } // { dg-skip-if "" { *-*-* } { "-flto" } { "" } }
// { dg-require-effective-target alloca }
extern "C" { extern "C" {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
// suppressing buffer overflow warnings. // suppressing buffer overflow warnings.
// { dg-skip-if "" { *-*-* } { "*" } { "-O0" "-O2" } } // { dg-skip-if "" { *-*-* } { "*" } { "-O0" "-O2" } }
// { dg-skip-if "" { *-*-* } { "-flto" } { "" } } // { dg-skip-if "" { *-*-* } { "-flto" } { "" } }
// { dg-require-effective-target alloca }
extern "C" { extern "C" {
......
// { dg-do compile } // { dg-do compile }
// { dg-require-effective-target alloca }
struct A struct A
{ {
A(int); A(int);
......
// { dg-do compile } // { dg-do compile }
// { dg-additional-options "-std=c++14" } // { dg-additional-options "-std=c++14" }
// { dg-require-effective-target alloca }
namespace std { namespace std {
typedef __SIZE_TYPE__ size_t; typedef __SIZE_TYPE__ size_t;
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
/* { dg-require-effective-target alloca } */
#include "check.h" #include "check.h"
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
/* { dg-require-effective-target alloca } */
#include "check.h" #include "check.h"
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
/* { dg-require-effective-target alloca } */
#include <stdarg.h> #include <stdarg.h>
#include "check.h" #include "check.h"
......
/* { dg-options "-Wno-abi" {target arm_eabi} } */ /* { dg-options "-Wno-abi" {target arm_eabi} } */
/* { dg-do run } */ /* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */ /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
/* { dg-require-effective-target alloca } */
#include <stdarg.h> #include <stdarg.h>
#include "check.h" #include "check.h"
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// warn_placement_new_too_small // warn_placement_new_too_small
// { dg-do compile } // { dg-do compile }
// { dg-additional-options "-Wplacement-new -Wno-pedantic" } // { dg-additional-options "-Wplacement-new -Wno-pedantic" }
// { dg-require-effective-target alloca }
#define SIZE_MAX __SIZE_MAX__ #define SIZE_MAX __SIZE_MAX__
#define DIFF_MAX __PTRDIFF_MAX__ #define DIFF_MAX __PTRDIFF_MAX__
......
// Test -Wsizeof-pointer-memaccess warnings. // Test -Wsizeof-pointer-memaccess warnings.
// { dg-do compile } // { dg-do compile }
// { dg-options "-Wall -Wno-sizeof-array-argument" } // { dg-options "-Wall -Wno-sizeof-array-argument" }
// { dg-require-effective-target alloca }
typedef __SIZE_TYPE__ size_t; typedef __SIZE_TYPE__ size_t;
extern "C" void *memset (void *, int, size_t); extern "C" void *memset (void *, int, size_t);
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-Wvla" } */ /* { dg-options "-Wvla" } */
/* { dg-require-effective-target alloca } */
void func (int i) void func (int i)
{ {
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-pedantic-errors -Wno-vla" } */ /* { dg-options "-pedantic-errors -Wno-vla" } */
/* { dg-require-effective-target alloca } */
/* { dg-require-effective-target alloca } */
void func (int i) void func (int i)
{ {
......
// { dg-do assemble } // { dg-do assemble }
// { dg-options "-w" } // { dg-options "-w" }
// { dg-require-effective-target alloca }
// This testcase used to cause a crash on the Alpha. // This testcase used to cause a crash on the Alpha.
struct A { struct A {
......
// { dg-do run } // { dg-do run }
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
// Testcase for constructor expressions (GNU extension) // Testcase for constructor expressions (GNU extension)
struct Any { struct Any {
......
// { dg-do run } // { dg-do run }
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
// GROUPS passed builtins // GROUPS passed builtins
// Apparently not in g++ bug snapshot (was originally sent to bug-gcc) // Apparently not in g++ bug snapshot (was originally sent to bug-gcc)
// Message-Id: <m0p74Fh-0002fCC@neal.ctd.comsat.com> // Message-Id: <m0p74Fh-0002fCC@neal.ctd.comsat.com>
......
// { dg-do assemble } // { dg-do assemble }
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
// Origin: Alfred Minarik <a8601248@unet.univie.ac.at> // Origin: Alfred Minarik <a8601248@unet.univie.ac.at>
template<typename T> template<typename T>
......
// { dg-do run } // { dg-do run }
// { dg-options "-O" } // { dg-options "-O" }
// { dg-require-effective-target alloca }
typedef struct { } e; typedef struct { } e;
char *p; char *p;
......
// { dg-do assemble } // { dg-do assemble }
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
// Origin: Alfred Minarik <a8601248@unet.univie.ac.at> // Origin: Alfred Minarik <a8601248@unet.univie.ac.at>
template<typename _CharT> template<typename _CharT>
......
// { dg-do assemble } // { dg-do assemble }
// { dg-options "" } // { dg-options "" }
// { dg-require-effective-target alloca }
// Origin: Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> // Origin: Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
inline const unsigned& f(unsigned const& a) { inline const unsigned& f(unsigned const& a) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment