blob: fc138ee8215780958d0afd55b7c80540c3b37bf0 [file] [log] [blame]
int test (void)
{
int *ptr = (int *)__builtin_malloc (sizeof (int));
*ptr = 42; /* { dg-warning "dereference of possibly-NULL 'ptr'" } */
__builtin_free (ptr);
return *ptr; /* { dg-warning "use after 'free' of 'ptr'" "use-after-free" } */
}