2016-12-07 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / Walloca-9.c
blobc67d9d632553ed1e8c970ab3338920d4e26c0a59
1 /* { dg-do compile } */
2 /* { dg-options "-Walloca-larger-than=5000 -O2" } */
4 extern void useit(char *);
6 int
7 foobar (unsigned short length)
9 char *pbuf;
10 __SIZE_TYPE__ size = (__SIZE_TYPE__) length;
12 if (size < 4032)
13 pbuf = (char *) __builtin_alloca(size);
14 else
15 pbuf = (char *) __builtin_malloc (size);
17 useit(pbuf);
18 return 0;