gcc/testsuite/c-c++-common/analyzer/call-summaries-1.c
raw| 1 | /* { dg-additional-options "-fanalyzer-call-summaries" } */ |
| 2 | /* { dg-skip-if "requires hosted libstdc++ for stdlib free" { ! hostedlib } } */ |
| 3 | |
| 4 | #include <stdlib.h> |
| 5 | |
| 6 | void calls_free (void *p) |
| 7 | { |
| 8 | free (p); /* { dg-warning "double-'free' of 'p'" } */ |
| 9 | } |
| 10 | |
| 11 | void test (void *q) |
| 12 | { |
| 13 | calls_free (q); |
| 14 | calls_free (q); |
| 15 | } |