1 /* { dg-do compile } */ 2 /* { dg-require-effective-target alloca } */ 3 /* { dg-options "-Walloca-larger-than=2000 -O2" } */ 4 5 void *p; 6 void foo(__SIZE_TYPE__ len)7foo (__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 } 14