1 2 3 4 5 6 7 8 9 10 11 12 13 14
/* { dg-skip-if "requires hosted libstdc++ for stdlib malloc" { ! hostedlib } } */ #include <stdlib.h> void test (void) { void *p = malloc (sizeof (int)); if (!p) return; int *q = (int *) p; if (!q) return; free (q); }