diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2016-10-19 18:41:36 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2016-10-19 18:41:36 +0000 |
commit | ec1748d461d757dd62af51d28406298beafd4d79 (patch) | |
tree | 82a7d7e128ca093047e68483df066003e8d90eeb /gcc | |
parent | 36e2520b479d85568e36982afe32c9dd652ebf76 (diff) | |
download | gcc-ec1748d461d757dd62af51d28406298beafd4d79.zip gcc-ec1748d461d757dd62af51d28406298beafd4d79.tar.gz gcc-ec1748d461d757dd62af51d28406298beafd4d79.tar.bz2 |
Walloca-1.c: Adjust test for !lp64 targets.
* gcc.dg/Walloca-1.c: Adjust test for !lp64 targets.
* gcc.dg/Walloca-2.c: Same.
From-SVN: r241351
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/Walloca-1.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/Walloca-2.c | 11 |
3 files changed, 15 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d3d269d..e6d84c3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2016-10-19 Aldy Hernandez <aldyh@redhat.com> + * gcc.dg/Walloca-1.c: Adjust test for !lp64 targets. + * gcc.dg/Walloca-2.c: Same. + +2016-10-19 Aldy Hernandez <aldyh@redhat.com> + * gcc.dg/Wvla-1.c: Rename to... * gcc.dg/Wvla-larger-than-1.c: ...this. * gcc.dg/Wvla-2.c: Rename to... diff --git a/gcc/testsuite/gcc.dg/Walloca-1.c b/gcc/testsuite/gcc.dg/Walloca-1.c index 34a20c3..32e4ab8 100644 --- a/gcc/testsuite/gcc.dg/Walloca-1.c +++ b/gcc/testsuite/gcc.dg/Walloca-1.c @@ -23,7 +23,8 @@ void foo1 (size_t len, size_t len2, size_t len3) char *s = alloca (123); useit (s); // OK, constant argument to alloca - s = alloca (num); // { dg-warning "large due to conversion" } + s = alloca (num); // { dg-warning "large due to conversion" "" { target lp64 } } + // { dg-warning "unbounded use of 'alloca'" "" { target { ! lp64 } } 26 } useit (s); s = alloca(90000); /* { dg-warning "is too large" } */ diff --git a/gcc/testsuite/gcc.dg/Walloca-2.c b/gcc/testsuite/gcc.dg/Walloca-2.c index 284b34e..4695fda 100644 --- a/gcc/testsuite/gcc.dg/Walloca-2.c +++ b/gcc/testsuite/gcc.dg/Walloca-2.c @@ -8,7 +8,11 @@ g1 (int n) { void *p; if (n > 0 && n < 2000) - p = __builtin_alloca (n); + // FIXME: This is a bogus warning, and is currently happening on + // 32-bit targets because VRP is not giving us any range info for + // the argument to __builtin_alloca. This should be fixed by the + // upcoming range work. + p = __builtin_alloca (n); // { dg-bogus "unbounded use of 'alloca'" "" { xfail { ! lp64 } } } else p = __builtin_malloc (n); f (p); @@ -31,8 +35,9 @@ g3 (int n) void *p; if (n > 0 && n < 3000) { - p = __builtin_alloca (n); // { dg-warning "'alloca' may be too large" } - // { dg-message "note:.*argument may be as large as 2999" "note" { target *-*-* } 34 } + p = __builtin_alloca (n); // { dg-warning "'alloca' may be too large" "" { target lp64} } + // { dg-message "note:.*argument may be as large as 2999" "note" { target lp64 } 38 } + // { dg-warning "unbounded use of 'alloca'" "" { target { ! lp64 } } 38 } } else p = __builtin_malloc (n); |