Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/Walloca-9.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 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 | |
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 } |