1 /* PR c/78284 - warn on malloc with very large arguments
2 Test verifying that the built-in allocation functions are declared
3 with attribute malloc. This means that the pointer they return
4 can be assumed not to alias any other valid pointer. */
5 /* { dg-do compile } */
6 /* { dg-require-effective-target alloca } */
7 /* { dg-options "-O2 -fdump-tree-optimized" } */
18 (x == 123) ? (void)0 : __builtin_abort (); \
22 void test (void *p
, unsigned n
)
24 TEST (__builtin_aligned_alloc (8, n
));
25 TEST (__builtin_alloca (n
));
26 TEST (__builtin_calloc (4, n
));
27 TEST (__builtin_malloc (n
));
28 TEST (__builtin_realloc (p
, n
+ 1));
31 /* { dg-final { scan-tree-dump-not "abort" "optimized" } } */