1 /* Manual reimplemenation of <cstdlib>, to test name-matching within std. */
5 typedef __SIZE_TYPE__ size_t;
6 void *malloc (std::size_t size);
7 void *calloc (std::size_t num, std::size_t size);
11 void test_1 (void *ptr)
13 std::free (ptr); /* { dg-message "first 'free' here" } */
14 std::free (ptr); /* { dg-warning "double-'free' of 'ptr'" } */
19 void *p = std::malloc (1024); /* { dg-message "allocated here" } */
20 } /* { dg-warning "leak of 'p'" } */
24 void *p = std::calloc (42, 1024); /* { dg-message "allocated here" } */
25 } /* { dg-warning "leak of 'p'" } */