Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / gcc.dg / Walloca-9.c
blobb82324a737392dbb537f3998dde5bf852f665c82
1 /* { dg-do compile } */
2 /* { dg-require-effective-target alloca } */
3 /* { dg-options "-Walloca-larger-than=5000 -O2" } */
5 extern void useit(char *);
7 int
8 foobar (unsigned short length)
10 char *pbuf;
11 __SIZE_TYPE__ size = (__SIZE_TYPE__) length;
13 if (size < 4032)
14 pbuf = (char *) __builtin_alloca(size);
15 else
16 pbuf = (char *) __builtin_malloc (size);
18 useit(pbuf);
19 return 0;