aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/analyzer/malloc-ipa-4.c
blob: 535979c7e0a6951a859500d170172d71f0e682b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-skip-if "requires hosted libstdc++ for stdlib free" { ! hostedlib } } */

#include <stdlib.h>

static void calls_free(int *q)
{
  free(q);
}

void test(void *p)
{
  calls_free((int *) p);

  free(p); /* { dg-warning "double-'free' of 'p'" } */
}