1 int test (void)
2 {
3 int *ptr = (int *)__builtin_malloc (sizeof (int));
4 *ptr = 42; /* { dg-warning "dereference of possibly-NULL 'ptr'" } */
5 __builtin_free (ptr);
6
7 return *ptr; /* { dg-warning "use after 'free' of 'ptr'" "use-after-free" } */
8 }