1 /* { dg-do compile } */
2 /* { dg-require-effective-target alloca } */
3 /* { dg-options "-Walloca-larger-than=2000 -O2" } */
11 if (n
> 0 && n
< 2000)
12 // FIXME: This is a bogus warning, and is currently happening on
13 // 32-bit targets because VRP is not giving us any range info for
14 // the argument to __builtin_alloca. This should be fixed by the
15 // upcoming range work.
16 p
= __builtin_alloca (n
); // { dg-bogus "unbounded use of 'alloca'" "" { xfail { ! lp64 } } }
18 p
= __builtin_malloc (n
);
27 p
= __builtin_alloca (n
); // { dg-warning "large due to conversion" }
29 p
= __builtin_malloc (n
);
37 if (n
> 0 && n
< 3000)
39 p
= __builtin_alloca (n
); // { dg-warning "'alloca' may be too large" "" { target lp64} }
40 // { dg-message "note:.*argument may be as large as 2999" "note" { target lp64 } .-1 }
41 // { dg-warning "unbounded use of 'alloca'" "" { target { ! lp64 } } .-2 }
44 p
= __builtin_malloc (n
);