1 /* { dg-do compile } */
2 /* { dg-require-effective-target alloca } */
3 /* { dg-options "-Walloca-larger-than=5000 -O2" } */
4 
5 extern void useit(char *);
6 
7 int
foobar(unsigned short length)8 foobar (unsigned short length)
9 {
10   char *pbuf;
11   __SIZE_TYPE__ size = (__SIZE_TYPE__) length;
12 
13   if (size < 4032)
14     pbuf = (char *) __builtin_alloca(size);
15   else
16     pbuf = (char *) __builtin_malloc (size);
17 
18   useit(pbuf);
19   return 0;
20 }
21