comparison gcc/testsuite/gcc.dg/Walloca-8.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-do compile } */
2 /* { dg-require-effective-target alloca } */
3 /* { dg-options "-Walloca-larger-than=2000 -O2" } */
4
5 void *p;
6 void
7 foo (__SIZE_TYPE__ len)
8 {
9 if (len < 2000 / sizeof (void *))
10 p = __builtin_alloca (len * sizeof (void *));
11 else
12 p = __builtin_malloc (len * sizeof (void *));
13 }