summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Walloca-15.c
blob: f34ffd98b617d4ed87caea013dd28eaeef84a099 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=128 -O2" } */

typedef __SIZE_TYPE__ size_t;

void bar (void*);

void foo1 (size_t len)
{
  bar (__builtin_alloca_with_align_and_max (len, 8, 128));
}

void foo2 (size_t len)
{
  bar (__builtin_alloca_with_align_and_max (len, 8, 256)); /* { dg-warning "may be too large" } */
}