1 /* Tests the warnings for insufficient allocation size.
3 { dg-options "-Walloc-size" }
6 struct b
{ int x
[10]; };
10 struct b
*p
= __builtin_malloc(sizeof *p
);
15 struct b
*p
= __builtin_malloc(sizeof p
); /* { dg-warning "allocation of insufficient size" } */
20 struct b
*p
= __builtin_alloca(sizeof p
); /* { dg-warning "allocation of insufficient size" } */
25 struct b
*p
= __builtin_calloc(1, sizeof p
); /* { dg-warning "allocation of insufficient size" } */
32 g(__builtin_malloc(4)); /* { dg-warning "allocation of insufficient size" } */