| 1 |
/* { dg-skip-if "requires hosted libstdc++ for stdlib malloc" { ! hostedlib } } */ |
| 2 |
|
| 3 |
#include <stdlib.h> |
| 4 |
#include "../../gcc.dg/analyzer/analyzer-decls.h" |
| 5 |
|
| 6 |
void *ptr; |
| 7 |
|
| 8 |
void test (void) |
| 9 |
{ |
| 10 |
ptr = malloc (1024); |
| 11 |
ptr = NULL; /* { dg-warning "leak of 'ptr'" } */ |
| 12 |
} |