Commit ec1748d4 by Aldy Hernandez Committed by Aldy Hernandez

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
parent 36e2520b
2016-10-19 Aldy Hernandez <aldyh@redhat.com> 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-1.c: Rename to...
* gcc.dg/Wvla-larger-than-1.c: ...this. * gcc.dg/Wvla-larger-than-1.c: ...this.
* gcc.dg/Wvla-2.c: Rename to... * gcc.dg/Wvla-2.c: Rename to...
......
...@@ -23,7 +23,8 @@ void foo1 (size_t len, size_t len2, size_t len3) ...@@ -23,7 +23,8 @@ void foo1 (size_t len, size_t len2, size_t len3)
char *s = alloca (123); char *s = alloca (123);
useit (s); // OK, constant argument to alloca 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); useit (s);
s = alloca(90000); /* { dg-warning "is too large" } */ s = alloca(90000); /* { dg-warning "is too large" } */
......
...@@ -8,7 +8,11 @@ g1 (int n) ...@@ -8,7 +8,11 @@ g1 (int n)
{ {
void *p; void *p;
if (n > 0 && n < 2000) 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 else
p = __builtin_malloc (n); p = __builtin_malloc (n);
f (p); f (p);
...@@ -31,8 +35,9 @@ g3 (int n) ...@@ -31,8 +35,9 @@ g3 (int n)
void *p; void *p;
if (n > 0 && n < 3000) if (n > 0 && n < 3000)
{ {
p = __builtin_alloca (n); // { dg-warning "'alloca' may be too large" } 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 *-*-* } 34 } // { dg-message "note:.*argument may be as large as 2999" "note" { target lp64 } 38 }
// { dg-warning "unbounded use of 'alloca'" "" { target { ! lp64 } } 38 }
} }
else else
p = __builtin_malloc (n); p = __builtin_malloc (n);
......
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